@preventive/deptree 1.5.2 → 1.5.3
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/bin/compare.js +10 -21
- package/bin/deptree.js +5 -10
- package/cargo.d.ts +139 -195
- package/cargo.js +0 -2
- package/cocoapods.d.ts +211 -381
- package/cocoapods.js +0 -2
- package/npm.d.ts +245 -369
- package/npm.js +4 -6
- package/package.json +1 -1
- package/pnpm.d.ts +258 -667
- package/pnpm.js +2 -4
- package/soldeer.d.ts +144 -215
- package/soldeer.js +0 -2
- package/src/cargo/crate.js +21 -46
- package/src/cargo/inputs.js +5 -8
- package/src/cargo/members.js +6 -12
- package/src/cargo/registry.js +5 -9
- package/src/cargo/tree.js +8 -13
- package/src/cargo/workspace.js +13 -26
- package/src/cocoapods/archive.js +19 -40
- package/src/cocoapods/clean.js +21 -45
- package/src/cocoapods/fnmatch.js +12 -27
- package/src/cocoapods/inputs.js +5 -11
- package/src/cocoapods/install.js +11 -24
- package/src/cocoapods/podspec.js +19 -40
- package/src/cocoapods/podtree.js +10 -19
- package/src/cocoapods/source.js +13 -30
- package/src/cocoapods/tree.js +17 -39
- package/src/cocoapods/unicode.js +3 -9
- package/src/github.js +12 -24
- package/src/glob.js +2 -4
- package/src/lazy.js +2 -4
- package/src/manifest.js +2 -4
- package/src/matcher.js +3 -5
- package/src/mount.js +7 -14
- package/src/npm/bins.js +3 -5
- package/src/npm/compat.js +3 -5
- package/src/npm/package.js +6 -12
- package/src/npm/ratio.js +3 -5
- package/src/npm/settings.js +3 -5
- package/src/npm/tree.js +6 -11
- package/src/npm/versions.js +3 -4
- package/src/npmrc.js +2 -4
- package/src/patch.js +8 -14
- package/src/pnpm/bins.js +16 -42
- package/src/pnpm/filename.js +2 -4
- package/src/pnpm/gitignore.js +2 -4
- package/src/pnpm/glob.js +3 -5
- package/src/pnpm/hoist.js +8 -16
- package/src/pnpm/hoisted.js +15 -44
- package/src/pnpm/hook.js +2 -4
- package/src/pnpm/install.js +5 -10
- package/src/pnpm/lazy.js +8 -23
- package/src/pnpm/local.js +2 -4
- package/src/pnpm/minimatch.js +8 -15
- package/src/pnpm/nm-hoist.js +5 -11
- package/src/pnpm/npm-packlist.js +3 -6
- package/src/pnpm/overrides.js +2 -4
- package/src/pnpm/package.js +10 -16
- package/src/pnpm/packlist.js +3 -7
- package/src/pnpm/patches.js +3 -4
- package/src/pnpm/production.js +9 -28
- package/src/pnpm/projects.js +2 -6
- package/src/pnpm/readers.js +2 -4
- package/src/pnpm/settings.js +2 -5
- package/src/pnpm/tree.js +14 -37
- package/src/pnpm/workspace.js +4 -7
- package/src/pnpm/write.js +1 -1
- package/src/soldeer/config.js +5 -9
- package/src/soldeer/tree.js +2 -4
- package/src/soldeer/zip.js +8 -17
- package/src/tarball.js +12 -29
- package/src/yarn1/compat.js +2 -4
- package/src/yarn1/hoist.js +3 -8
- package/src/yarn1/package.js +12 -23
- package/src/yarn1/resolve.js +6 -11
- package/src/yarn1/settings.js +5 -10
- package/src/yarn1/tree.js +9 -18
- package/yarn1.d.ts +203 -360
- package/yarn1.js +4 -6
package/cocoapods.d.ts
CHANGED
|
@@ -1,420 +1,250 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The pods' directories `pod install` makes in Pods/ from a Podfile.lock, built in memory
|
|
3
|
+
*
|
|
4
|
+
* ```js
|
|
5
|
+
* import { buildCocoaPodsTree } from '@preventive/deptree/cocoapods.js'
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Each podspec, tarball and archive is fetched through `@preventive/upstream`: a podspec from CocoaPods'
|
|
9
|
+
* own spec repos ($CP_REPOS_DIR, $CP_HOME_DIR/repos or ~/.cocoapods/repos) where one there has the
|
|
10
|
+
* lockfile's checksum, which are never written, else its own cache (`setCacheDir`). That is the one place
|
|
11
|
+
* a filesystem is touched. Nothing is left to a guess: what CocoaPods would read otherwise, what one
|
|
12
|
+
* release of it or of Ruby reads otherwise than another, or what this cannot reproduce exactly, is refused.
|
|
13
|
+
*
|
|
14
|
+
* @module @preventive/deptree/cocoapods.js
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { Client } from '@preventive/upstream/github.js';
|
|
18
|
+
import type { NodeType, Vfs } from '@preventive/vfs';
|
|
19
|
+
|
|
20
|
+
export { LockfileError } from '@preventive/lockfile/cocoapods.js';
|
|
21
|
+
|
|
22
|
+
// Where `@preventive/upstream` caches podspecs, tarballs and archives: setCacheDir() the default, false none, as until set
|
|
23
|
+
export { setCacheDir } from '@preventive/upstream/npm.js';
|
|
24
|
+
|
|
25
|
+
/** The machine CocoaPods would install on */
|
|
22
26
|
export interface CocoaPodsHost {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
/** The exact CocoaPods that installs, 1.13.0 to 1.17.x */
|
|
28
|
+
cocoapods: string;
|
|
29
|
+
/** As Node names it, `darwin` or `linux` */
|
|
30
|
+
os: string;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
export type CocoaPodsPlatform = 'ios' | 'osx' | 'tvos' | 'visionos' | 'watchos'
|
|
33
|
+
/** A platform the Podfile's targets are for, as CocoaPods names it */
|
|
34
|
+
export type CocoaPodsPlatform = 'ios' | 'osx' | 'tvos' | 'visionos' | 'watchos';
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// pod by :podspec. The lockfile is read as UTF-8, and refused where it is
|
|
37
|
-
// not; the Podfile and the podspecs as bytes, the Podfile not read
|
|
38
|
-
// otherwise. Nothing is written to it.
|
|
36
|
+
/**
|
|
37
|
+
* The project's root, by paths from `/`: a Vfs, or anything with these methods, such as a view of a
|
|
38
|
+
* directory on disk. Only Podfile.lock (as UTF-8), the Podfile (the first of CocoaPods.podfile.yaml,
|
|
39
|
+
* CocoaPods.podfile, Podfile and Podfile.rb) and, without `podspecs`, Pods/Local
|
|
40
|
+
* Podspecs/<name>.podspec.json are read; nothing is written.
|
|
41
|
+
*/
|
|
39
42
|
export interface CocoaPodsProject {
|
|
40
|
-
readdir(path: string): string[]
|
|
41
|
-
lstat(path: string): { type: NodeType }
|
|
42
|
-
stat(path: string): { type: NodeType }
|
|
43
|
-
readFile(path: string): Uint8Array
|
|
43
|
+
readdir(path: string): string[];
|
|
44
|
+
lstat(path: string): { type: NodeType };
|
|
45
|
+
stat(path: string): { type: NodeType };
|
|
46
|
+
readFile(path: string): Uint8Array;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// The two ways the files come, one or the other: given, with `lockfile`
|
|
54
|
-
// and, where it is, `podfile`, as text or bytes; or read, with `project`
|
|
55
|
-
// and neither of them. A Podfile given is held to PODFILE CHECKSUM as one
|
|
56
|
-
// read is; without one, nothing is.
|
|
57
|
-
//
|
|
58
|
-
// `platforms` are those the Podfile's targets are for, by CocoaPods' names;
|
|
59
|
-
// left out, any. A spec installed has to name the same files on each of
|
|
60
|
-
// those it takes, as the lockfile does not say which targets, of which
|
|
61
|
-
// platforms, it is installed for; one that names other files on another is
|
|
62
|
-
// refused. A spec for none of them is refused too.
|
|
63
|
-
//
|
|
64
|
-
// `podspecs` are the podspecs of the pods by :podspec, by name, each as
|
|
65
|
-
// text or bytes: the JSON CocoaPods writes of one as Pods/Local
|
|
66
|
-
// Podspecs/<name>.podspec.json, which is what SPEC CHECKSUMS has the sha1
|
|
67
|
-
// of, the podspec it evaluated and not its Ruby, which is not read here.
|
|
68
|
-
// Each is held to that checksum. Left out where `project` is given, those
|
|
69
|
-
// in the project's Pods/Local Podspecs are read; left out where `lockfile`
|
|
70
|
-
// is, there are none. One the lockfile has no pod by :podspec of is not
|
|
71
|
-
// read. A pod by :podspec without one is refused, or with `partial`
|
|
72
|
-
// skipped.
|
|
73
|
-
//
|
|
74
|
-
// `manifest` writes Pods/Manifest.lock too, CocoaPods' record of what is
|
|
75
|
-
// in Pods/: the lockfile's bytes, as CocoaPods writes the two alike, and
|
|
76
|
-
// as the Check Pods Manifest.lock phase of a build holds them to be. With
|
|
77
|
-
// it there, `pod install` downloads no pod whose directory is there and
|
|
78
|
-
// which the manifest has at the version, checksum, specs and dependency it
|
|
79
|
-
// resolves; it downloads only the pods whose directory is not there, or
|
|
80
|
-
// holds nothing but names that start with `.`, which it takes to be empty;
|
|
81
|
-
// then it generates the rest of Pods/ as it does. Without it, CocoaPods
|
|
82
|
-
// takes Pods/ to hold nothing, and downloads every pod again.
|
|
83
|
-
//
|
|
84
|
-
// `partial` skips each pod refused for where it is downloaded from, as the
|
|
85
|
-
// lockfile or its podspec says, rather than refusing the call: one from a
|
|
86
|
-
// spec repo but trunk, or an external source but :path and :podspec; one by
|
|
87
|
-
// :podspec without its podspec, or with CHECKOUT OPTIONS; one with a
|
|
88
|
-
// prepare_command, without `prepare`; and one whose source is neither git
|
|
89
|
-
// from GitHub by a full commit, without its submodules, nor :http as
|
|
90
|
-
// below: one by a tag among them. Nothing is written for it, and it is
|
|
91
|
-
// listed in `skipped`, for CocoaPods to download: with `manifest`, it
|
|
92
|
-
// downloads those and no other.
|
|
93
|
-
// A podspec is held to the lockfile's checksum all the same, and an archive
|
|
94
|
-
// to its hash. Every other refusal stands. So everything written is held to
|
|
95
|
-
// a hash the lockfile holds, or that a podspec it holds does, whether
|
|
96
|
-
// `partial` is given or not.
|
|
97
|
-
//
|
|
98
|
-
// `only` names the pods to download, by the lockfile's names of them, each
|
|
99
|
-
// once: for a Pods/ that has the others already, as its Manifest.lock
|
|
100
|
-
// says. No other pod is looked at: its podspec is not fetched, nor its
|
|
101
|
-
// source, its prepare_command is not run, and it is neither written,
|
|
102
|
-
// refused nor listed in `skipped`. A name the lockfile has no pod of is
|
|
103
|
-
// refused. Left out, every pod CocoaPods downloads is downloaded.
|
|
104
|
-
//
|
|
105
|
-
// `vfs` is a Vfs to mount the tree into, at its root, which is taken to be
|
|
106
|
-
// the project's -- it may be `project` too; without one, a new Vfs holds
|
|
107
|
-
// the tree alone. A Vfs that holds a `Pods` at its root, or on macOS a name
|
|
108
|
-
// that is one there, is refused before anything is fetched, as CocoaPods
|
|
109
|
-
// keeps and removes what is in it by its own record of it. Nothing there
|
|
110
|
-
// is written over: each directory the tree has is one there or is made,
|
|
111
|
-
// and every file is written where nothing is. The tree is built, and held
|
|
112
|
-
// to every check below, before any of it is written, so a refusal leaves
|
|
113
|
-
// the Vfs as it was.
|
|
114
|
-
//
|
|
115
|
-
// `prepare` runs a pod's prepare_command, the script CocoaPods runs with
|
|
116
|
-
// bash in its copy of the download before it cleans it, which nothing here
|
|
117
|
-
// runs: it is called for each pod downloaded whose podspec has one, with
|
|
118
|
-
// the pod's `name` and `version`, the `command` as the podspec gives it,
|
|
119
|
-
// and the download's `contents`, a copy -- and gives back, or comes to, the
|
|
120
|
-
// contents as they are after the command, which are cleaned then as the
|
|
121
|
-
// podspec has them. What the command makes of the download is the caller's
|
|
122
|
-
// to answer for: no hash holds it. Left out, a pod with a prepare_command
|
|
123
|
-
// is refused, or with `partial` skipped.
|
|
124
|
-
//
|
|
125
|
-
// `github` is the client from @preventive/upstream/github.js's createClient
|
|
126
|
-
// each pod is fetched through, with whatever token it was made with, or
|
|
127
|
-
// none. It is needed only where the lockfile has a pod CocoaPods
|
|
128
|
-
// downloads, and there it is a TypeError to leave it out, before anything
|
|
129
|
-
// is fetched.
|
|
130
|
-
export type CocoaPodsTreeOptions = CocoaPodsTreeGiven | CocoaPodsTreeRead
|
|
49
|
+
/**
|
|
50
|
+
* The files `pod install` reads, given (`lockfile`, and `podfile` as text or bytes) or read from `project`
|
|
51
|
+
*
|
|
52
|
+
* The Podfile is held to PODFILE CHECKSUM and not read otherwise: its install! options, hooks, targets and
|
|
53
|
+
* platforms are taken to be as `buildCocoaPodsTree` describes. Without a Podfile given, nothing is.
|
|
54
|
+
*/
|
|
55
|
+
export type CocoaPodsTreeOptions = CocoaPodsTreeGiven | CocoaPodsTreeRead;
|
|
131
56
|
|
|
132
|
-
|
|
133
|
-
// its directories, its files, each with its bytes and its mode, and its
|
|
134
|
-
// symlinks, each with its target.
|
|
57
|
+
/** A download, or what is left of one, by paths from the pod's directory */
|
|
135
58
|
export interface CocoaPodsContents {
|
|
136
|
-
dirs: Iterable<string
|
|
137
|
-
files: Map<string, { data: Uint8Array
|
|
138
|
-
|
|
59
|
+
dirs: Iterable<string>;
|
|
60
|
+
files: Map<string, { data: Uint8Array; mode: number }>;
|
|
61
|
+
/** Each symlink's target */
|
|
62
|
+
links: Map<string, string>;
|
|
139
63
|
}
|
|
140
64
|
|
|
65
|
+
/** What `prepare` is called with */
|
|
141
66
|
export interface CocoaPodsPrepare {
|
|
142
|
-
name: string
|
|
143
|
-
version: string
|
|
144
|
-
|
|
145
|
-
|
|
67
|
+
name: string;
|
|
68
|
+
version: string;
|
|
69
|
+
/** The prepare_command, as the podspec gives it */
|
|
70
|
+
command: string;
|
|
71
|
+
/** A copy of the download */
|
|
72
|
+
contents: CocoaPodsContents;
|
|
146
73
|
}
|
|
147
74
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
75
|
+
interface CocoaPodsTreeCommon {
|
|
76
|
+
host: CocoaPodsHost;
|
|
77
|
+
/**
|
|
78
|
+
* What the Podfile's targets are for (default: any). A spec installed has to name the same files on
|
|
79
|
+
* each of them it takes, as the lockfile does not say which it is installed for, and one for none of
|
|
80
|
+
* them is refused.
|
|
81
|
+
*/
|
|
82
|
+
platforms?: CocoaPodsPlatform[];
|
|
83
|
+
/**
|
|
84
|
+
* The podspecs of pods by :podspec, by name, as the JSON CocoaPods writes as Pods/Local
|
|
85
|
+
* Podspecs/<name>.podspec.json, each held to SPEC CHECKSUMS (default: the project's, or none). A pod
|
|
86
|
+
* by :podspec without one is refused, or with `partial` skipped.
|
|
87
|
+
*/
|
|
88
|
+
podspecs?: Record<string, string | Uint8Array>;
|
|
89
|
+
/**
|
|
90
|
+
* Write Pods/Manifest.lock too, the lockfile's bytes, as CocoaPods does. With it there, `pod install`
|
|
91
|
+
* downloads only the pods whose directory is missing or holds only names starting with `.`; without
|
|
92
|
+
* it, every pod again.
|
|
93
|
+
*/
|
|
94
|
+
manifest?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Skip, rather than refuse, each pod refused for where it is downloaded from, listing it in `skipped`
|
|
97
|
+
* for CocoaPods to download: one from a spec repo but trunk or an external source but :path and
|
|
98
|
+
* :podspec, one by :podspec without its podspec or with CHECKOUT OPTIONS, one with a prepare_command
|
|
99
|
+
* without `prepare`, and one whose source is not one supported, such as a tag. Hashes hold all the same.
|
|
100
|
+
*/
|
|
101
|
+
partial?: boolean;
|
|
102
|
+
/** The pods to download, by the lockfile's names, each once; no other is looked at (default: every pod) */
|
|
103
|
+
only?: string[];
|
|
104
|
+
/**
|
|
105
|
+
* Run a pod's prepare_command, which nothing here runs, giving back the contents as they are after it,
|
|
106
|
+
* which are then cleaned. No hash holds what it makes; without it, such a pod is refused or skipped.
|
|
107
|
+
*/
|
|
108
|
+
prepare?: (pod: CocoaPodsPrepare) => CocoaPodsContents | Promise<CocoaPodsContents>;
|
|
109
|
+
/**
|
|
110
|
+
* A Vfs to mount the tree into, at the project's root (it may be `project`), or a new one. One that
|
|
111
|
+
* holds a `Pods` (on macOS, a name that is one there) is refused before anything is fetched. Nothing
|
|
112
|
+
* there is written over, and a refusal leaves it as it was.
|
|
113
|
+
*/
|
|
114
|
+
vfs?: Vfs;
|
|
115
|
+
/** From upstream's `createClient`, which each pod is fetched through; a TypeError where one is downloaded without it */
|
|
116
|
+
github?: Client;
|
|
161
117
|
}
|
|
162
118
|
|
|
163
|
-
export interface
|
|
164
|
-
lockfile
|
|
165
|
-
podfile?:
|
|
166
|
-
project
|
|
167
|
-
host: CocoaPodsHost
|
|
168
|
-
platforms?: CocoaPodsPlatform[]
|
|
169
|
-
podspecs?: Record<string, string | Uint8Array>
|
|
170
|
-
manifest?: boolean
|
|
171
|
-
partial?: boolean
|
|
172
|
-
only?: string[]
|
|
173
|
-
prepare?: (pod: CocoaPodsPrepare) => CocoaPodsContents | Promise<CocoaPodsContents>
|
|
174
|
-
vfs?: Vfs
|
|
175
|
-
github?: Client
|
|
119
|
+
export interface CocoaPodsTreeGiven extends CocoaPodsTreeCommon {
|
|
120
|
+
lockfile: string;
|
|
121
|
+
podfile?: string | Uint8Array;
|
|
122
|
+
project?: undefined;
|
|
176
123
|
}
|
|
177
124
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
125
|
+
export interface CocoaPodsTreeRead extends CocoaPodsTreeCommon {
|
|
126
|
+
lockfile?: undefined;
|
|
127
|
+
podfile?: undefined;
|
|
128
|
+
project: CocoaPodsProject;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** What was installed */
|
|
184
132
|
export interface CocoaPodsTreeStats {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
133
|
+
/** The lockfile's roots */
|
|
134
|
+
pods: number;
|
|
135
|
+
/** Those written into Pods/, each a podspec and a tarball or archive fetched; the rest by :path, or skipped */
|
|
136
|
+
downloaded: number;
|
|
137
|
+
/** Files written, Manifest.lock among them */
|
|
138
|
+
files: number;
|
|
139
|
+
/** Bytes written */
|
|
140
|
+
bytes: number;
|
|
141
|
+
/** Symlinks written */
|
|
142
|
+
links: number;
|
|
190
143
|
}
|
|
191
144
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// and `version` the lockfile's, of the root; `checksum` the hex sha1 its
|
|
195
|
-
// podspec is held to, SPEC CHECKSUMS'; `pods` the specs of it installed,
|
|
196
|
-
// the root and its subspecs as PODS names them.
|
|
197
|
-
export type CocoaPodsInstalled = CocoaPodsInstalledGit | CocoaPodsInstalledHttp
|
|
145
|
+
/** A pod as an SBOM would list it */
|
|
146
|
+
export type CocoaPodsInstalled = CocoaPodsInstalledGit | CocoaPodsInstalledHttp;
|
|
198
147
|
|
|
199
148
|
export interface CocoaPodsInstalledPod {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
149
|
+
/** `Pods/<name>`, from the project's root */
|
|
150
|
+
path: string;
|
|
151
|
+
/** The root's, as the lockfile has it */
|
|
152
|
+
name: string;
|
|
153
|
+
version: string;
|
|
154
|
+
/** The hex sha1 its podspec is held to, SPEC CHECKSUMS' */
|
|
155
|
+
checksum: string;
|
|
156
|
+
/** The specs installed, as PODS names them */
|
|
157
|
+
pods: string[];
|
|
205
158
|
}
|
|
206
159
|
|
|
207
|
-
// From git: `git` is the repository's URL as the podspec gives it, and
|
|
208
|
-
// `commit` the commit the podspec names, which is checked out.
|
|
209
160
|
export interface CocoaPodsInstalledGit extends CocoaPodsInstalledPod {
|
|
210
|
-
|
|
211
|
-
|
|
161
|
+
/** The repository's URL, as the podspec gives it */
|
|
162
|
+
git: string;
|
|
163
|
+
/** The commit the podspec names, which is checked out */
|
|
164
|
+
commit: string;
|
|
212
165
|
}
|
|
213
166
|
|
|
214
|
-
// By :http: `http` is the archive's URL as the podspec gives it, and
|
|
215
|
-
// `sha256` the podspec's hash of it, which it is held to.
|
|
216
167
|
export interface CocoaPodsInstalledHttp extends CocoaPodsInstalledPod {
|
|
217
|
-
|
|
218
|
-
|
|
168
|
+
/** The archive's URL, as the podspec gives it */
|
|
169
|
+
http: string;
|
|
170
|
+
/** The podspec's hash of it, which it is held to */
|
|
171
|
+
sha256: string;
|
|
219
172
|
}
|
|
220
173
|
|
|
221
|
-
|
|
222
|
-
// `reason` the refusal's message, as the call throws it without `partial`,
|
|
223
|
-
// leading with `pods["<name>"]`.
|
|
174
|
+
/** A pod `partial` skips */
|
|
224
175
|
export interface CocoaPodsSkipped {
|
|
225
|
-
name: string
|
|
226
|
-
version: string
|
|
227
|
-
|
|
176
|
+
name: string;
|
|
177
|
+
version: string;
|
|
178
|
+
/** What the call would throw without `partial`, leading with `pods["<name>"]` */
|
|
179
|
+
reason: string;
|
|
228
180
|
}
|
|
229
181
|
|
|
230
|
-
// `vfs` is the one given, the tree mounted into it, or a new one.
|
|
231
|
-
// `installed` is each pod downloaded, in the lockfile's order; `skipped`
|
|
232
|
-
// each pod `partial` skips, in the lockfile's order, and none without it.
|
|
233
182
|
export interface CocoaPodsTree {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
183
|
+
/** The one given, the tree mounted into it, or a new one */
|
|
184
|
+
vfs: Vfs;
|
|
185
|
+
stats: CocoaPodsTreeStats;
|
|
186
|
+
/** In the lockfile's order */
|
|
187
|
+
installed: CocoaPodsInstalled[];
|
|
188
|
+
/** In the lockfile's order; none without `partial` */
|
|
189
|
+
skipped: CocoaPodsSkipped[];
|
|
238
190
|
}
|
|
239
191
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// Native publishes its archives under: its URL
|
|
295
|
-
// https://repo1.maven.org/maven2/com/facebook/ and a path under it, such as
|
|
296
|
-
// `react/react-native-artifacts/<version>/<file>.tar.gz`, ending in
|
|
297
|
-
// `.tar.gz` or `.zip` alone, with no :type, or the tgz or the zip that
|
|
298
|
-
// names. Either as upstream's isPodArchiveUrl takes it: exactly as the URL
|
|
299
|
-
// parser writes it back out, so that no `..` takes it out from under the
|
|
300
|
-
// prefix it is written with, with no query, fragment, credentials or port,
|
|
301
|
-
// each segment of the path letters, digits, `_`, `.`, `~`, `@`, `-` or a
|
|
302
|
-
// %-escape in capitals. The podspec has to hold it to its :sha256, in
|
|
303
|
-
// lowercase hex, as RemoteFile checks one before a :sha1, and does: so the
|
|
304
|
-
// lockfile's checksum of the podspec is the archive's as well. One held to
|
|
305
|
-
// a :sha1 alone, which two archives can be made to share, is refused, and
|
|
306
|
-
// so is one held to no hash, as React Native's own podspecs,
|
|
307
|
-
// hermes-engine's and ReactNativeDependencies', name theirs on Maven
|
|
308
|
-
// Central. It is fetched with upstream's getPodArchive, which follows
|
|
309
|
-
// GitHub's redirects, and Maven Central's to repo.reactnative.dev, and
|
|
310
|
-
// holds the bytes to that hash. Its type is RemoteFile's, by :type or else
|
|
311
|
-
// by the end of its URL's path: tgz, tar, tbz or txz, which it extracts
|
|
312
|
-
// with `tar xf`, or zip, with `unzip`; a dmg is refused.
|
|
313
|
-
//
|
|
314
|
-
// A tar is read by what it is, as `tar xf` reads it, gzipped or not, as GNU
|
|
315
|
-
// tar and bsdtar extract one for a user other than root, under a umask of
|
|
316
|
-
// 0o022: each file of its mode but the group's and others' write, each
|
|
317
|
-
// symlink to its target, a hard link a copy of what it links to, as
|
|
318
|
-
// CocoaPods' copies into its cache and into Pods/ make it. What one
|
|
319
|
-
// machine's tar would make otherwise than another's is refused: another
|
|
320
|
-
// compression than gzip, or a zip, which bsdtar reads and GNU tar does not;
|
|
321
|
-
// a setuid, setgid or sticky bit; a directory its owner cannot list and
|
|
322
|
-
// write in, or a file it cannot read, which CocoaPods' cleaner and copy
|
|
323
|
-
// would fail on; a name starting with `._`, which bsdtar on macOS reads as
|
|
324
|
-
// the extended attributes of another; a `.git` in a path; a FIFO or a
|
|
325
|
-
// device.
|
|
326
|
-
//
|
|
327
|
-
// A zip is read as Info-ZIP's unzip 6.0 extracts one under that umask: a
|
|
328
|
-
// file of the mode a Unix maker stored, but for a setuid, setgid or sticky
|
|
329
|
-
// bit, and of 0o644, or 0o444 by the DOS read-only bit, from any other
|
|
330
|
-
// maker, unless it stored a Unix mode that agrees with those bits, which is
|
|
331
|
-
// kept; a symlink by its mode, from a Unix maker; an MS-DOS volume label
|
|
332
|
-
// left out, as unzip skips one. Refused is what unzip would stop and ask
|
|
333
|
-
// about, which fails `pod install`, or write otherwise
|
|
334
|
-
// than @preventive/archive/zip.js reads it, beside what that reader
|
|
335
|
-
// refuses: an empty archive; a name again; an entry that needs PKZIP past
|
|
336
|
-
// 4.5, or is marked as stored in VMS format; an Amiga or THEOS maker; a
|
|
337
|
-
// name outside ASCII, or ending in a `.` segment or in `;` and digits; a
|
|
338
|
-
// directory its owner cannot list and write in, or a file it cannot read;
|
|
339
|
-
// a `.git` in a path.
|
|
340
|
-
//
|
|
341
|
-
// Either is then flattened as RemoteFile flattens it, by :flatten where
|
|
342
|
-
// that is given, as Ruby reads a value, and else a tar always and a zip
|
|
343
|
-
// never: where it holds one thing, and that a directory, its contents in
|
|
344
|
-
// its place. What its moves would meet is refused: the name it downloads
|
|
345
|
-
// the archive under, `file.<type>`, at its root; the one thing to flatten a
|
|
346
|
-
// link, or of a name ending in `.`, or holding its name and `.tmp`. An
|
|
347
|
-
// :http source with :headers, which curl sends, is refused.
|
|
348
|
-
//
|
|
349
|
-
// Every podspec is fetched and held to all that it says, below as here,
|
|
350
|
-
// before any tarball or archive is fetched, so that a pod refused costs no
|
|
351
|
-
// download; a tarball or an archive is fetched once, for all the pods of
|
|
352
|
-
// it.
|
|
353
|
-
//
|
|
354
|
-
// What CocoaPods then keeps of the download is what it keeps: it cleans
|
|
355
|
-
// the download in its cache, by the file patterns of every spec of the
|
|
356
|
-
// podspec on every platform each takes, copies that into Pods/, and cleans
|
|
357
|
-
// it again there by those of the specs the lockfile installs, each a
|
|
358
|
-
// Sandbox::PodDirCleaner, with a FileAccessor per spec and platform over a
|
|
359
|
-
// PathList of what is there. Each is followed as CocoaPods has it, with
|
|
360
|
-
// File.fnmatch as Ruby has it, case folded for ASCII alone: a pattern that
|
|
361
|
-
// is a path there taken as it is, else one that names a directory with
|
|
362
|
-
// what lies under it, then the braces expanded as PathList expands them
|
|
363
|
-
// and matched; exclude_files taken out; the readme and the license the
|
|
364
|
-
// first found where the podspec names no license file there; a path
|
|
365
|
-
// removed with all under it but where it ends in `.` or, downcased, it is a
|
|
366
|
-
// used file's path or one of the two is at the start of the other, as
|
|
367
|
-
// Ruby's `include?` finds it in the pod's directory's path. Each source
|
|
368
|
-
// file is then made read-only by its owner, through a link to the file it
|
|
369
|
-
// leads to, as lock_files! leaves it. A link is followed as the machine
|
|
370
|
-
// follows it, on macOS to a name whatever its case and normalization, up to
|
|
371
|
-
// 40 links on the way on Linux and 32 on macOS, past which the path leads
|
|
372
|
-
// nowhere, and a link to nothing at all leads nowhere. A link CocoaPods
|
|
373
|
-
// follows to find whether it leads to a directory, which is every link, and
|
|
374
|
-
// which leads out of the download, is refused, as what it finds there is
|
|
375
|
-
// the machine's.
|
|
376
|
-
//
|
|
377
|
-
// What CocoaPods fails on is refused: a podspec that is not JSON, a value
|
|
378
|
-
// of a type it fails on, a source file that links to nothing, a pod named
|
|
379
|
-
// as what it writes beside the pods in Pods/, a path in the download of
|
|
380
|
-
// 4096 bytes or more on Linux, 1024 on macOS, or with a name of more than
|
|
381
|
-
// 255. So is what CocoaPods cleans otherwise than its patterns say: a pod
|
|
382
|
-
// named with a glob's `*`, `?`, `[`, `]`, `{` or `}`, whose directory it
|
|
383
|
-
// then cleans by that glob; and, from 1.13 to 1.15, a pod whose patterns
|
|
384
|
-
// keep the .git of the clone that they copy into their cache, as what is in
|
|
385
|
-
// it is not known. And what one release of CocoaPods or Ruby reads
|
|
386
|
-
// otherwise than another: a platform named in another case, or `xros`; a
|
|
387
|
-
// value that breaks braces apart by a backslash; a path, a link's target or
|
|
388
|
-
// a pattern with a letter whose case Ruby maps otherwise in a release from
|
|
389
|
-
// 2.6 on than in another, as one encoded after Unicode 12.1. A pattern
|
|
390
|
-
// longer than 4096 characters, or that expands to more than 4096, is
|
|
391
|
-
// refused, and so is a pod whose patterns take more than 200,000,000
|
|
392
|
-
// matches of a path to clean it, and a readme or a license of two files of
|
|
393
|
-
// one name but for case, of which CocoaPods takes either. On macOS, a
|
|
394
|
-
// download with two names in one directory that differ only in case or
|
|
395
|
-
// normalization is refused, as they would be one name there and git's
|
|
396
|
-
// checkout writes one of them alone, whatever CocoaPods keeps of it.
|
|
397
|
-
//
|
|
398
|
-
// Pods come from trunk, as SPEC REPOS has it, by `trunk` or by the git
|
|
399
|
-
// repository of CocoaPods/Specs, by :podspec, or by :path: one from another
|
|
400
|
-
// spec repo, one from any other external source, one by :podspec that
|
|
401
|
-
// CHECKOUT OPTIONS has, which CocoaPods downloads by those, one with a
|
|
402
|
-
// prepare_command, which CocoaPods runs as a script in the download and
|
|
403
|
-
// `prepare` is not given to run, and one whose source is neither git from GitHub, by a full commit and
|
|
404
|
-
// without its submodules, nor :http as above, is refused, or with `partial`
|
|
405
|
-
// skipped: one by a tag or a branch among them.
|
|
406
|
-
//
|
|
407
|
-
// Nothing is left to a guess: a lockfile the lockfile reader refuses, a pod
|
|
408
|
-
// from anywhere but trunk and :podspec, a check above that fails -- each is
|
|
409
|
-
// refused with a DeptreeError or a LockfileError that says where. A
|
|
410
|
-
// TypeError is thrown for options of the wrong type, and for a pod to
|
|
411
|
-
// download without `github`.
|
|
412
|
-
export function buildCocoaPodsTree(options: CocoaPodsTreeOptions): Promise<CocoaPodsTree>
|
|
413
|
-
|
|
414
|
-
// `where` is what a refusal is about -- `pods["Alamofire"]`, a path in a
|
|
415
|
-
// pod's download -- or undefined for the call as a whole; the message leads
|
|
416
|
-
// with it. `cause` is what a package beneath refused with, where one did.
|
|
192
|
+
/**
|
|
193
|
+
* The pods' directories `pod install` makes, with `host.cocoapods`, in a project with no Pods directory
|
|
194
|
+
* yet: `Pods/<name>` for each root CocoaPods downloads, and nothing else but Manifest.lock with `manifest`
|
|
195
|
+
*
|
|
196
|
+
* Taken to be as they are by default: the install! options, no hook that changes a download, CocoaPods'
|
|
197
|
+
* download cache used, each pod in one pod target, and the project's and cache's paths with no glob
|
|
198
|
+
* character and as NFKC normalizes them, as CocoaPods cleans by them. A pod by :path is read where it is.
|
|
199
|
+
*
|
|
200
|
+
* Each root's podspec is fetched from trunk (a :podspec one is `podspecs`'), held to the lockfile's sha1,
|
|
201
|
+
* and every podspec is checked whole before any download, each download fetched once for all its pods.
|
|
202
|
+
* Its source has to be one of:
|
|
203
|
+
* - git from GitHub by a full commit, without submodules: the tarball of the commit's tree, held to the
|
|
204
|
+
* commit's id and in the history of the default branch, written as git checks out with no config under
|
|
205
|
+
* a 0o022 umask. A tag is refused, as nothing would hold it to a hash. Refused: what upstream or
|
|
206
|
+
* `@preventive/archive/tar.js` refuses, and a path git refuses to check out (a `.git` or `git~1` in it).
|
|
207
|
+
* - :http from https://github.com/<owner>/<repo>/ or, a .tar.gz or .zip, from Maven Central's
|
|
208
|
+
* com/facebook/, as `isPodArchiveUrl` takes a URL, held to its lowercase :sha256 (a :sha1 alone, or no
|
|
209
|
+
* hash, is refused), of the type RemoteFile reads off :type or the URL; a dmg, or :headers, is refused.
|
|
210
|
+
*
|
|
211
|
+
* A tar is read as GNU tar and bsdtar extract it for a user but root under a 0o022 umask, a hard link a
|
|
212
|
+
* copy of its target; refused is what one machine's tar makes otherwise than another's: compression but
|
|
213
|
+
* gzip, a zip, a setuid, setgid or sticky bit, a directory its owner cannot list and write in or a file it
|
|
214
|
+
* cannot read, a name starting with `._`, a `.git`, a FIFO or a device. A zip is read as Info-ZIP's unzip
|
|
215
|
+
* 6.0 extracts it; refused is what unzip would ask about or write otherwise than `@preventive/archive/zip.js`
|
|
216
|
+
* reads it: an empty archive, a name again, PKZIP past 4.5, VMS, an Amiga or THEOS maker, a name outside
|
|
217
|
+
* ASCII or ending in `.` or `;` and digits, the same modes as of a tar, a `.git`. Either is flattened as
|
|
218
|
+
* RemoteFile flattens it; what its moves would meet is refused.
|
|
219
|
+
*
|
|
220
|
+
* The download is cleaned as CocoaPods' PodDirCleaner cleans it, by every spec on every platform in the
|
|
221
|
+
* cache and by the specs installed in Pods/, with File.fnmatch as Ruby has it, and each source file made
|
|
222
|
+
* read-only by its owner, as lock_files! leaves it. A link is followed as the machine follows it; one
|
|
223
|
+
* that leads out of the download is refused. Refused too:
|
|
224
|
+
* - what CocoaPods fails on: a podspec that is not JSON, a value of a type it fails on, a source file
|
|
225
|
+
* linking to nothing, a pod named as what it writes in Pods/, a path or name too long for the machine
|
|
226
|
+
* - what it cleans otherwise than the patterns say: a pod named with a glob character, and before 1.16
|
|
227
|
+
* patterns that keep the clone's .git
|
|
228
|
+
* - what one release reads otherwise than another: a platform in another case or `xros`, a backslash in
|
|
229
|
+
* braces, a letter whose case Ruby maps otherwise from 2.6 on
|
|
230
|
+
* - a pattern over 4096 characters or expanding to over 4096, a pod taking over 200,000,000 matches to
|
|
231
|
+
* clean, a readme or license of two files one name but for case
|
|
232
|
+
* - on macOS, two names in a download that are one there
|
|
233
|
+
*
|
|
234
|
+
* A pod from a spec repo but trunk, from an external source but :podspec and :path, by :podspec with
|
|
235
|
+
* CHECKOUT OPTIONS, with a prepare_command and no `prepare`, or of a source not above is refused, or
|
|
236
|
+
* with `partial` skipped.
|
|
237
|
+
*
|
|
238
|
+
* @param options - The files and where to build
|
|
239
|
+
* @returns The tree, what it holds, its pods, and those skipped
|
|
240
|
+
* @throws DeptreeError or LockfileError saying where; TypeError for options of the wrong type, or a pod
|
|
241
|
+
* to download without `github`
|
|
242
|
+
*/
|
|
243
|
+
export function buildCocoaPodsTree(options: CocoaPodsTreeOptions): Promise<CocoaPodsTree>;
|
|
244
|
+
|
|
245
|
+
/** A refusal */
|
|
417
246
|
export class DeptreeError extends Error {
|
|
418
|
-
constructor(detail: string, where?: string, options?: { cause?: unknown })
|
|
419
|
-
|
|
247
|
+
constructor(detail: string, where?: string, options?: { cause?: unknown });
|
|
248
|
+
/** What it is about, such as `pods["Alamofire"]`, which the message leads with; undefined for the call */
|
|
249
|
+
where: string | undefined;
|
|
420
250
|
}
|