@vltpkg/types 0.0.0-0.1730239248325

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/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Copyright (c) vlt technology, Inc.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7
+ Subject to the terms and conditions of this license, each copyright holder and contributor hereby grants to those receiving rights under this license a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except for failure to satisfy the conditions of this license) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer this software, where such license applies only to those patent claims, already acquired or hereafter acquired, licensable by such copyright holder or contributor that are necessarily infringed by:
8
+
9
+ (a) their Contribution(s) (the licensed copyrights of copyright holders and non-copyrightable additions of contributors, in source or binary form) alone; or
10
+ (b) combination of their Contribution(s) with the work of authorship to which such Contribution(s) was added by such copyright holder or contributor, if, at the time the Contribution is added, such addition causes such combination to be necessarily infringed. The patent license shall not apply to any other combinations which include the Contribution.
11
+ Except as expressly stated above, no rights or licenses from any copyright holder or contributor is granted under this license, whether expressly, by implication, estoppel or otherwise.
12
+
13
+ DISCLAIMER
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # `@vltpkg/types`
2
+
3
+ A module for a handful of core types that are used
4
+ throughout vlt extensively, and don't belong to any one
5
+ particular implementation.
6
+
7
+ ## USAGE
8
+
9
+ ```js
10
+ import {
11
+ type Manifest,
12
+ type Packument,
13
+ type Integrity,
14
+ type Signature,
15
+ isManifest,
16
+ isPackument,
17
+ isIntegrity,
18
+ } from '@vltpkg/types'
19
+
20
+ const mani: Manifest = {
21
+ name: 'hello',
22
+ version: '1.2.3',
23
+ dist: {
24
+ tarball: 'https://example.com/hello-1.2.3.tgz',
25
+ integrity: 'sha512-3yWxPTq3Uq/imagine/if/this/was/the/integrity/wow/it/could/happen/just/very/unlikely/00==',
26
+ },
27
+ }
28
+ mani.dist.integrity
29
+ // ^? Integrity | undefined
30
+ const someRandomObject = {
31
+ name: 'foo',
32
+ version: '1.2.3',
33
+ }
34
+ if (isManifest(someRandomObject)) {
35
+ someRandomObject
36
+ // ^? Manifest
37
+ }
38
+ ```
@@ -0,0 +1,164 @@
1
+ /** anything that can be encoded in JSON */
2
+ export type JSONField = JSONField[] | boolean | number | string | {
3
+ [k: string]: JSONField;
4
+ } | null;
5
+ /** sha512 SRI string */
6
+ export type Integrity = `sha512-${string}`;
7
+ /** SHA256 key identifier */
8
+ export type KeyID = `SHA256:${string}`;
9
+ /** The Manifest['dist'] field present in registry manifests */
10
+ export type Dist = {
11
+ integrity?: Integrity;
12
+ shasum?: string;
13
+ tarball?: string;
14
+ fileCount?: number;
15
+ unpackedSize?: number;
16
+ signatures?: {
17
+ keyid: KeyID;
18
+ sig: string;
19
+ }[];
20
+ };
21
+ /** An object used to mark some peerDeps as optional */
22
+ export type PeerDependenciesMetaValue = {
23
+ optional?: boolean;
24
+ };
25
+ export type ConditionalValueObject = {
26
+ [k: string]: ConditionalValue;
27
+ };
28
+ export type ConditionalValue = ConditionalValue[] | ConditionalValueObject | string | null;
29
+ export type ExportsSubpaths = {
30
+ [path in '.' | `./${string}`]?: ConditionalValue;
31
+ };
32
+ export type Exports = Exclude<ConditionalValue, null> | ExportsSubpaths;
33
+ export type Imports = Record<`#${string}`, ConditionalValue>;
34
+ export type FundingEntry = string | {
35
+ url: string;
36
+ };
37
+ export type Funding = FundingEntry | FundingEntry[];
38
+ export type Person = string | {
39
+ name: string;
40
+ url?: string;
41
+ email?: string;
42
+ };
43
+ export type Repository = string | {
44
+ type: string;
45
+ url: string;
46
+ };
47
+ export type Bugs = string | {
48
+ url?: string;
49
+ email?: string;
50
+ };
51
+ export type Manifest = {
52
+ /** The name of the package. optional because {} is a valid package.json */
53
+ name?: string;
54
+ /** The version of the package. optional because {} is a valid package.json */
55
+ version?: string;
56
+ /** production dependencies, name:specifier */
57
+ dependencies?: Record<string, string>;
58
+ /** development dependencies, name:specifier */
59
+ devDependencies?: Record<string, string>;
60
+ /** optional dependencies, name:specifier */
61
+ optionalDependencies?: Record<string, string>;
62
+ /** peer dependencies, name:specifier */
63
+ peerDependencies?: Record<string, string>;
64
+ /** peer dependencies marked as optional */
65
+ peerDependenciesMeta?: Record<string, PeerDependenciesMetaValue>;
66
+ /** dependency ranges that are acceptable, but not forced */
67
+ acceptDependencies?: Record<string, string>;
68
+ /** names of dependencies included in the package tarball */
69
+ bundleDependencies?: string[];
70
+ /** a message indicating that this is not to be used */
71
+ deprecated?: string;
72
+ /** executable built and linked by this package */
73
+ bin?: Record<string, string> | string;
74
+ /** run-script actions for this package */
75
+ scripts?: Record<string, string>;
76
+ /** supported run-time platforms this package can run on */
77
+ engines?: Record<string, string>;
78
+ /** supported operating systems this package can run on */
79
+ os?: string[] | string;
80
+ /** supported CPU architectures this package can run on */
81
+ cpu?: string[] | string;
82
+ /** URLs that can be visited to fund this project */
83
+ funding?: Funding;
84
+ /**
85
+ * Only present in Manifests served by a registry. Contains information
86
+ * about the artifact served for this package release.
87
+ */
88
+ dist?: Dist;
89
+ /** a short description of the package */
90
+ description?: string;
91
+ /** search keywords */
92
+ keywords?: string[];
93
+ /** where to go to file issues */
94
+ bugs?: Bugs;
95
+ /** where the development happens */
96
+ repository?: Repository;
97
+ /** the main module, if exports['.'] is not set */
98
+ main?: string;
99
+ /** named subpath exports */
100
+ exports?: Exports;
101
+ /** named #identifier imports */
102
+ imports?: Imports;
103
+ /**
104
+ * the HEAD of the git repo this was published from
105
+ * only present in published packages
106
+ */
107
+ gitHead?: string;
108
+ /** whether the package is private */
109
+ private?: boolean;
110
+ /** whether this is ESM or CommonJS by default */
111
+ type?: 'commonjs' | 'module';
112
+ /** npm puts this on published manifests */
113
+ gypfile?: boolean;
114
+ };
115
+ export type ManifestRegistry = Manifest & Required<Pick<Manifest, 'name' | 'version' | 'dist'>>;
116
+ export type Packument = {
117
+ name: string;
118
+ 'dist-tags': Record<string, string>;
119
+ versions: Record<string, Manifest>;
120
+ modified?: string;
121
+ time?: Record<string, string>;
122
+ readme?: string;
123
+ };
124
+ export type RefType = 'branch' | 'head' | 'other' | 'pull' | 'tag';
125
+ /**
126
+ * A representation of a given remote ref in a {@link RevDoc} object.
127
+ */
128
+ export type RevDocEntry = Omit<Manifest, 'type'> & Required<Pick<Manifest, 'version'>> & {
129
+ /** sha this references */
130
+ sha: string;
131
+ /** ref as passed git locally */
132
+ ref: string;
133
+ /** canonical full ref, like `refs/tags/blahblah` */
134
+ rawRef: string;
135
+ /** what type of ref this is: 'branch', 'tag', etc. */
136
+ type: RefType;
137
+ };
138
+ /**
139
+ * An object kind of resembling a packument, but about a git repo.
140
+ */
141
+ export type RevDoc = Omit<Packument, 'versions'> & {
142
+ /** all semver-looking tags go in this record */
143
+ versions: Record<string, RevDocEntry>;
144
+ /** all named things that can be cloned down remotely */
145
+ refs: Record<string, RevDocEntry>;
146
+ /** all named shas referenced above */
147
+ shas: Record<string, string[]>;
148
+ };
149
+ export declare const isIntegrity: (i: unknown) => i is Integrity;
150
+ export declare const asIntegrity: (i: unknown) => Integrity;
151
+ export declare const assertIntegrity: (i: unknown) => asserts i is Integrity;
152
+ export declare const isKeyID: (k: unknown) => k is KeyID;
153
+ export declare const asKeyID: (k: unknown) => KeyID;
154
+ export declare const assertKeyID: (k: unknown) => asserts k is KeyID;
155
+ export declare const isManifest: (m: any) => m is Manifest;
156
+ export declare const isManifestRegistry: (m: unknown) => m is ManifestRegistry;
157
+ export declare const asManifest: (m: unknown, from?: (...a: any[]) => any) => Manifest;
158
+ export declare const asManifestRegistry: (m: unknown, from?: (...a: any[]) => any) => ManifestRegistry;
159
+ export declare const assertManifest: (m: unknown) => asserts m is Manifest;
160
+ export declare const assertManifestRegistry: (m: unknown) => asserts m is ManifestRegistry;
161
+ export declare const isPackument: (p: any) => p is Packument;
162
+ export declare const asPackument: (p: unknown, from?: (...a: unknown[]) => any) => Packument;
163
+ export declare const assertPackument: (m: unknown) => asserts m is Packument;
164
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GACjB,SAAS,EAAE,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC1B,IAAI,CAAA;AAER,wBAAwB;AACxB,MAAM,MAAM,SAAS,GAAG,UAAU,MAAM,EAAE,CAAA;AAE1C,4BAA4B;AAC5B,MAAM,MAAM,KAAK,GAAG,UAAU,MAAM,EAAE,CAAA;AAEtC,+DAA+D;AAC/D,MAAM,MAAM,IAAI,GAAG;IACjB,SAAS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,QAYtB,CAAA;AAEnB,eAAO,MAAM,kBAAkB,MAC1B,OAAO,KACT,CAAC,IAAI,gBAC8C,CAAA;AAEtD,eAAO,MAAM,UAAU,MAClB,OAAO,SACH,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,KAC1B,QAKF,CAAA;AAED,eAAO,MAAM,kBAAkB,MAC1B,OAAO,SACH,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,GAAG,KAC1B,gBASF,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,CAC3B,CAAC,EAAE,OAAO,KACP,OAAO,CAAC,CAAC,IAAI,QAEjB,CAAA;AACD,eAAO,MAAM,sBAAsB,EAAE,CACnC,CAAC,EAAE,OAAO,KACP,OAAO,CAAC,CAAC,IAAI,gBAEjB,CAAA;AAED,eAAO,MAAM,WAAW,MAAO,GAAG,KAAG,CAAC,IAAI,SASvC,CAAA;AAEH,eAAO,MAAM,WAAW,MACnB,OAAO,SACH,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,GAAG,KAC9B,SASF,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,CAC5B,CAAC,EAAE,OAAO,KACP,OAAO,CAAC,CAAC,IAAI,SAEjB,CAAA"}
@@ -0,0 +1,90 @@
1
+ import { error } from '@vltpkg/error-cause';
2
+ const integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/;
3
+ export const isIntegrity = (i) => typeof i === 'string' && integrityRE.test(i);
4
+ export const asIntegrity = (i) => {
5
+ if (!isIntegrity(i)) {
6
+ throw error('invalid integrity', {
7
+ found: i,
8
+ wanted: integrityRE,
9
+ }, asIntegrity);
10
+ }
11
+ return i;
12
+ };
13
+ export const assertIntegrity = i => {
14
+ asIntegrity(i);
15
+ };
16
+ const keyIDRE = /^SHA256:[a-zA-Z0-9/+]{43}$/;
17
+ export const isKeyID = (k) => typeof k === 'string' && keyIDRE.test(k);
18
+ export const asKeyID = (k) => {
19
+ if (!isKeyID(k)) {
20
+ throw error('invalid key ID', {
21
+ found: k,
22
+ wanted: keyIDRE,
23
+ }, asKeyID);
24
+ }
25
+ return k;
26
+ };
27
+ export const assertKeyID = k => {
28
+ asKeyID(k);
29
+ };
30
+ const maybeRecordStringString = (o) => o === undefined || isRecordStringString(o);
31
+ const isRecordStringString = (o) => isRecordStringT(o, s => typeof s === 'string');
32
+ const isRecordStringT = (o, check) => !!o &&
33
+ typeof o === 'object' &&
34
+ Object.entries(o).every(([k, v]) => typeof k === 'string' && check(v));
35
+ const isRecordStringManifest = (o) => isRecordStringT(o, v => isManifest(v));
36
+ const maybePeerDependenciesMetaSet = (o) => o === undefined ||
37
+ isRecordStringT(o, v => isPeerDependenciesMetaValue(v));
38
+ const maybeBoolean = (o) => o === undefined || typeof o === 'boolean';
39
+ const isPeerDependenciesMetaValue = (o) => !!o && typeof o === 'object' && maybeBoolean(o.optional);
40
+ const maybeString = (a) => a === undefined || typeof a === 'string';
41
+ const maybeDist = (a) => a === undefined ||
42
+ (!!a && typeof a === 'object' && maybeString(a.tarball));
43
+ export const isManifest = (m) => !!m &&
44
+ typeof m === 'object' &&
45
+ !Array.isArray(m) &&
46
+ maybeString(m.name) &&
47
+ maybeString(m.version) &&
48
+ maybeRecordStringString(m.dependencies) &&
49
+ maybeRecordStringString(m.devDependencies) &&
50
+ maybeRecordStringString(m.optionalDependencies) &&
51
+ maybeRecordStringString(m.peerDependencies) &&
52
+ maybeRecordStringString(m.acceptDependencies) &&
53
+ maybePeerDependenciesMetaSet(m.peerDependenciesMeta) &&
54
+ maybeDist(m.dist);
55
+ export const isManifestRegistry = (m) => isManifest(m) && !!m.dist && !!m.name && !!m.version;
56
+ export const asManifest = (m, from) => {
57
+ if (!isManifest(m)) {
58
+ throw error('invalid manifest', { found: m }, from ?? asManifest);
59
+ }
60
+ return m;
61
+ };
62
+ export const asManifestRegistry = (m, from) => {
63
+ if (!isManifestRegistry(m)) {
64
+ throw error('invalid registry manifest', { found: m }, from ?? asManifestRegistry);
65
+ }
66
+ return m;
67
+ };
68
+ export const assertManifest = m => {
69
+ asManifest(m, assertManifest);
70
+ };
71
+ export const assertManifestRegistry = m => {
72
+ asManifestRegistry(m, assertManifestRegistry);
73
+ };
74
+ export const isPackument = (p) => !!p &&
75
+ typeof p === 'object' &&
76
+ typeof p.name === 'string' &&
77
+ isRecordStringString(p['dist-tags']) &&
78
+ isRecordStringManifest(p.versions) &&
79
+ maybeRecordStringString(p.time) &&
80
+ Object.values(p['dist-tags']).every(v => !!p.versions[v] && p.versions[v].name == p.name);
81
+ export const asPackument = (p, from) => {
82
+ if (!isPackument(p)) {
83
+ throw error('invalid packument', { found: p }, from ?? asPackument);
84
+ }
85
+ return p;
86
+ };
87
+ export const assertPackument = m => {
88
+ asPackument(m);
89
+ };
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AA4L3C,MAAM,WAAW,GAAG,8BAA8B,CAAA;AAClD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAU,EAAkB,EAAE,CACxD,OAAO,CAAC,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAU,EAAa,EAAE;IACnD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,MAAM,KAAK,CACT,mBAAmB,EACnB;YACE,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,WAAW;SACpB,EACD,WAAW,CACZ,CAAA;IACH,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAEE,CAAC,CAAC,EAAE;IAChC,WAAW,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,4BAA4B,C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B,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;IAC1B,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACpC,sBAAsB,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CACjC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CACrD,CAAA;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,CAAU,EACV,IAA+B,EACpB,EAAE;IACb,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,MAAM,KAAK,CACT,mBAAmB,EACnB,EAAE,KAAK,EAAE,CAAC,EAAE,EACZ,IAAI,IAAI,WAAW,CACpB,CAAA;IACH,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAEE,CAAC,CAAC,EAAE;IAChC,WAAW,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import { error } from '@vltpkg/error-cause'\n\n/** anything that can be encoded in JSON */\nexport type JSONField =\n | JSONField[]\n | boolean\n | number\n | string\n | { [k: string]: JSONField }\n | null\n\n/** sha512 SRI string */\nexport type Integrity = `sha512-${string}`\n\n/** SHA256 key identifier */\nexport type KeyID = `SHA256:${string}`\n\n/** The Manifest['dist'] field present in registry manifests */\nexport type Dist = {\n integrity?: Integrity\n shasum?: string\n tarball?: string\n fileCount?: number\n unpackedSize?: number\n signatures?: {\n keyid: KeyID\n sig: string\n }[]\n}\n\n/** An object used to mark some peerDeps as optional */\nexport type PeerDependenciesMetaValue = {\n optional?: boolean\n}\n\n// Don't use Record here since TS cant do circular references with that\n// https://github.com/microsoft/TypeScript/issues/41164#issuecomment-1427073368\nexport type ConditionalValueObject = {\n [k: string]: ConditionalValue\n}\n\nexport type ConditionalValue =\n | ConditionalValue[]\n | ConditionalValueObject\n | string\n | null\n\nexport type ExportsSubpaths = {\n [path in '.' | `./${string}`]?: ConditionalValue\n}\n\nexport type Exports =\n | Exclude<ConditionalValue, null>\n | ExportsSubpaths\n\nexport type Imports = Record<`#${string}`, ConditionalValue>\n\nexport type FundingEntry = string | { url: string }\nexport type Funding = FundingEntry | FundingEntry[]\n\nexport type Person =\n | string\n | {\n name: string\n url?: string\n email?: string\n }\n\nexport type Repository =\n | string\n | {\n type: string\n url: string\n }\n\nexport type Bugs =\n | string\n | {\n url?: string\n email?: string\n }\n\nexport type Manifest = {\n /** The name of the package. optional because {} is a valid package.json */\n name?: string\n /** The version of the package. optional because {} is a valid package.json */\n version?: string\n /** production dependencies, name:specifier */\n dependencies?: Record<string, string>\n /** development dependencies, name:specifier */\n devDependencies?: Record<string, string>\n /** optional dependencies, name:specifier */\n optionalDependencies?: Record<string, string>\n /** peer dependencies, name:specifier */\n peerDependencies?: Record<string, string>\n /** peer dependencies marked as optional */\n peerDependenciesMeta?: Record<string, PeerDependenciesMetaValue>\n /** dependency ranges that are acceptable, but not forced */\n acceptDependencies?: Record<string, string>\n /** names of dependencies included in the package tarball */\n bundleDependencies?: string[]\n /** a message indicating that this is not to be used */\n deprecated?: string\n /** executable built and linked by this package */\n bin?: Record<string, string> | string\n /** run-script actions for this package */\n scripts?: Record<string, string>\n /** supported run-time platforms this package can run on */\n engines?: Record<string, string>\n /** supported operating systems this package can run on */\n os?: string[] | string\n /** supported CPU architectures this package can run on */\n cpu?: string[] | string\n /** URLs that can be visited to fund this project */\n funding?: Funding\n /**\n * Only present in Manifests served by a registry. Contains information\n * about the artifact served for this package release.\n */\n dist?: Dist\n /** a short description of the package */\n description?: string\n /** search keywords */\n keywords?: string[]\n /** where to go to file issues */\n bugs?: Bugs\n /** where the development happens */\n repository?: Repository\n /** the main module, if exports['.'] is not set */\n main?: string\n /** named subpath exports */\n exports?: Exports\n /** named #identifier imports */\n imports?: Imports\n /**\n * the HEAD of the git repo this was published from\n * only present in published packages\n */\n gitHead?: string\n /** whether the package is private */\n private?: boolean\n /** whether this is ESM or CommonJS by default */\n type?: 'commonjs' | 'module'\n /** npm puts this on published manifests */\n gypfile?: boolean\n}\n\nexport type ManifestRegistry = Manifest &\n Required<Pick<Manifest, 'name' | 'version' | 'dist'>>\n\nexport type Packument = {\n name: string\n 'dist-tags': Record<string, string>\n versions: Record<string, Manifest>\n modified?: string\n time?: Record<string, string>\n readme?: string\n}\n\nexport type RefType = 'branch' | 'head' | 'other' | 'pull' | 'tag'\n\n/**\n * A representation of a given remote ref in a {@link RevDoc} object.\n */\nexport type RevDocEntry = Omit<Manifest, 'type'> &\n Required<Pick<Manifest, 'version'>> & {\n /** sha this references */\n sha: string\n /** ref as passed git locally */\n ref: string\n /** canonical full ref, like `refs/tags/blahblah` */\n rawRef: string\n /** what type of ref this is: 'branch', 'tag', etc. */\n type: RefType\n }\n\n/**\n * An object kind of resembling a packument, but about a git repo.\n */\nexport type RevDoc = Omit<Packument, 'versions'> & {\n /** all semver-looking tags go in this record */\n versions: Record<string, RevDocEntry>\n /** all named things that can be cloned down remotely */\n refs: Record<string, RevDocEntry>\n /** all named shas referenced above */\n shas: Record<string, string[]>\n}\n\nconst integrityRE = /^sha512-[a-zA-Z0-9/+]{86}==$/\nexport const isIntegrity = (i: unknown): i is Integrity =>\n typeof i === 'string' && integrityRE.test(i)\n\nexport const asIntegrity = (i: unknown): Integrity => {\n if (!isIntegrity(i)) {\n throw error(\n 'invalid integrity',\n {\n found: i,\n wanted: integrityRE,\n },\n asIntegrity,\n )\n }\n return i\n}\n\nexport const assertIntegrity: (\n i: unknown,\n) => asserts i is Integrity = i => {\n asIntegrity(i)\n}\n\nconst keyIDRE = /^SHA256:[a-zA-Z0-9/+]{43}$/\nexport const isKeyID = (k: unknown): k is KeyID =>\n typeof k === 'string' && keyIDRE.test(k)\n\nexport const asKeyID = (k: unknown): KeyID => {\n if (!isKeyID(k)) {\n throw error(\n 'invalid key ID',\n {\n found: k,\n wanted: keyIDRE,\n },\n asKeyID,\n )\n }\n return k\n}\n\nexport const assertKeyID: (k: unknown) => asserts k is KeyID = k => {\n asKeyID(k)\n}\n\nconst maybeRecordStringString = (\n o: unknown,\n): o is Record<string, string> | undefined =>\n o === undefined || isRecordStringString(o)\n\nconst isRecordStringString = (\n o: unknown,\n): o is Record<string, string> =>\n isRecordStringT<string>(o, s => typeof s === 'string')\n\nconst isRecordStringT = <T>(\n o: unknown,\n check: (o: unknown) => boolean,\n): o is Record<string, T> =>\n !!o &&\n typeof o === 'object' &&\n Object.entries(o).every(\n ([k, v]) => typeof k === 'string' && check(v),\n )\n\nconst isRecordStringManifest = (\n o: unknown,\n): o is Record<string, Manifest> =>\n isRecordStringT<Manifest>(o, v => isManifest(v))\n\nconst maybePeerDependenciesMetaSet = (\n o: unknown,\n): o is Record<string, PeerDependenciesMetaValue> | undefined =>\n o === undefined ||\n isRecordStringT<PeerDependenciesMetaValue>(o, v =>\n isPeerDependenciesMetaValue(v),\n )\n\nconst maybeBoolean = (o: unknown): o is boolean =>\n o === undefined || typeof o === 'boolean'\n\nconst isPeerDependenciesMetaValue = (\n o: any,\n): o is PeerDependenciesMetaValue =>\n !!o && typeof o === 'object' && maybeBoolean(o.optional)\n\nconst maybeString = (a: unknown): a is string | undefined =>\n a === undefined || typeof a === 'string'\n\nconst maybeDist = (a: any): a is Manifest['dist'] =>\n a === undefined ||\n (!!a && typeof a === 'object' && maybeString(a.tarball))\n\nexport const isManifest = (m: any): m is Manifest =>\n !!m &&\n typeof m === 'object' &&\n !Array.isArray(m) &&\n maybeString(m.name) &&\n maybeString(m.version) &&\n maybeRecordStringString(m.dependencies) &&\n maybeRecordStringString(m.devDependencies) &&\n maybeRecordStringString(m.optionalDependencies) &&\n maybeRecordStringString(m.peerDependencies) &&\n maybeRecordStringString(m.acceptDependencies) &&\n maybePeerDependenciesMetaSet(m.peerDependenciesMeta) &&\n maybeDist(m.dist)\n\nexport const isManifestRegistry = (\n m: unknown,\n): m is ManifestRegistry =>\n isManifest(m) && !!m.dist && !!m.name && !!m.version\n\nexport const asManifest = (\n m: unknown,\n from?: (...a: any[]) => any,\n): Manifest => {\n if (!isManifest(m)) {\n throw error('invalid manifest', { found: m }, from ?? asManifest)\n }\n return m\n}\n\nexport const asManifestRegistry = (\n m: unknown,\n from?: (...a: any[]) => any,\n): ManifestRegistry => {\n if (!isManifestRegistry(m)) {\n throw error(\n 'invalid registry manifest',\n { found: m },\n from ?? asManifestRegistry,\n )\n }\n return m\n}\n\nexport const assertManifest: (\n m: unknown,\n) => asserts m is Manifest = m => {\n asManifest(m, assertManifest)\n}\nexport const assertManifestRegistry: (\n m: unknown,\n) => asserts m is ManifestRegistry = m => {\n asManifestRegistry(m, assertManifestRegistry)\n}\n\nexport const isPackument = (p: any): p is Packument =>\n !!p &&\n typeof p === 'object' &&\n typeof p.name === 'string' &&\n isRecordStringString(p['dist-tags']) &&\n isRecordStringManifest(p.versions) &&\n maybeRecordStringString(p.time) &&\n Object.values(p['dist-tags']).every(\n v => !!p.versions[v] && p.versions[v].name == p.name,\n )\n\nexport const asPackument = (\n p: unknown,\n from?: (...a: unknown[]) => any,\n): Packument => {\n if (!isPackument(p)) {\n throw error(\n 'invalid packument',\n { found: p },\n from ?? asPackument,\n )\n }\n return p\n}\n\nexport const assertPackument: (\n m: unknown,\n) => asserts m is Packument = m => {\n asPackument(m)\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@vltpkg/types",
3
+ "description": "definitions for some of vlt's core types",
4
+ "version": "0.0.0-0.1730239248325",
5
+ "tshy": {
6
+ "selfLink": false,
7
+ "dialects": [
8
+ "esm"
9
+ ],
10
+ "exports": {
11
+ "./package.json": "./package.json",
12
+ ".": "./src/index.ts"
13
+ }
14
+ },
15
+ "dependencies": {
16
+ "@vltpkg/error-cause": "0.0.0-0.1730239248325"
17
+ },
18
+ "devDependencies": {
19
+ "@eslint/js": "^9.8.0",
20
+ "@types/eslint__js": "^8.42.3",
21
+ "@types/node": "^22.4.1",
22
+ "eslint": "^9.8.0",
23
+ "prettier": "^3.3.2",
24
+ "tap": "^21.0.1",
25
+ "tshy": "^3.0.2",
26
+ "typescript": "^5.5.4",
27
+ "typescript-eslint": "^8.0.1"
28
+ },
29
+ "license": "BSD-2-Clause-Patent",
30
+ "engines": {
31
+ "node": "20 || >=22"
32
+ },
33
+ "tap": {
34
+ "extends": "../../tap-config.yaml"
35
+ },
36
+ "prettier": "../../.prettierrc.js",
37
+ "module": "./dist/esm/index.js",
38
+ "type": "module",
39
+ "exports": {
40
+ "./package.json": "./package.json",
41
+ ".": {
42
+ "import": {
43
+ "types": "./dist/esm/index.d.ts",
44
+ "default": "./dist/esm/index.js"
45
+ }
46
+ }
47
+ },
48
+ "files": [
49
+ "dist"
50
+ ],
51
+ "scripts": {
52
+ "format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
53
+ "format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
54
+ "lint": "eslint . --fix",
55
+ "lint:check": "eslint .",
56
+ "presnap": "tshy",
57
+ "snap": "tap",
58
+ "pretest": "tshy",
59
+ "test": "tap"
60
+ }
61
+ }