@preventive/deptree 1.5.2 → 1.5.4

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.
Files changed (80) hide show
  1. package/bin/compare.js +10 -21
  2. package/bin/deptree.js +5 -10
  3. package/cargo.d.ts +139 -195
  4. package/cargo.js +0 -2
  5. package/cocoapods.d.ts +211 -381
  6. package/cocoapods.js +0 -2
  7. package/npm.d.ts +245 -369
  8. package/npm.js +4 -6
  9. package/package.json +1 -1
  10. package/pnpm.d.ts +258 -667
  11. package/pnpm.js +2 -4
  12. package/soldeer.d.ts +144 -215
  13. package/soldeer.js +0 -2
  14. package/src/cargo/crate.js +21 -46
  15. package/src/cargo/inputs.js +5 -8
  16. package/src/cargo/members.js +6 -12
  17. package/src/cargo/registry.js +5 -9
  18. package/src/cargo/tree.js +8 -13
  19. package/src/cargo/workspace.js +13 -26
  20. package/src/cocoapods/archive.js +19 -40
  21. package/src/cocoapods/clean.js +21 -45
  22. package/src/cocoapods/fnmatch.js +12 -27
  23. package/src/cocoapods/inputs.js +5 -11
  24. package/src/cocoapods/install.js +11 -24
  25. package/src/cocoapods/podspec.js +19 -40
  26. package/src/cocoapods/podtree.js +10 -19
  27. package/src/cocoapods/source.js +13 -30
  28. package/src/cocoapods/tree.js +17 -39
  29. package/src/cocoapods/unicode.js +3 -9
  30. package/src/github.js +12 -24
  31. package/src/glob.js +2 -4
  32. package/src/lazy.js +2 -4
  33. package/src/manifest.js +2 -4
  34. package/src/matcher.js +3 -5
  35. package/src/mount.js +7 -14
  36. package/src/npm/bins.js +3 -5
  37. package/src/npm/compat.js +3 -5
  38. package/src/npm/package.js +13 -14
  39. package/src/npm/ratio.js +3 -5
  40. package/src/npm/settings.js +3 -5
  41. package/src/npm/tree.js +6 -11
  42. package/src/npm/versions.js +3 -4
  43. package/src/npmrc.js +2 -4
  44. package/src/patch.js +8 -14
  45. package/src/pnpm/bins.js +16 -42
  46. package/src/pnpm/filename.js +2 -4
  47. package/src/pnpm/gitignore.js +2 -4
  48. package/src/pnpm/glob.js +3 -5
  49. package/src/pnpm/hoist.js +8 -16
  50. package/src/pnpm/hoisted.js +15 -44
  51. package/src/pnpm/hook.js +2 -4
  52. package/src/pnpm/install.js +5 -10
  53. package/src/pnpm/lazy.js +8 -23
  54. package/src/pnpm/local.js +2 -4
  55. package/src/pnpm/minimatch.js +8 -15
  56. package/src/pnpm/nm-hoist.js +5 -11
  57. package/src/pnpm/npm-packlist.js +3 -6
  58. package/src/pnpm/overrides.js +2 -4
  59. package/src/pnpm/package.js +10 -16
  60. package/src/pnpm/packlist.js +3 -7
  61. package/src/pnpm/patches.js +3 -4
  62. package/src/pnpm/production.js +9 -28
  63. package/src/pnpm/projects.js +2 -6
  64. package/src/pnpm/readers.js +2 -4
  65. package/src/pnpm/settings.js +2 -5
  66. package/src/pnpm/tree.js +14 -37
  67. package/src/pnpm/workspace.js +4 -7
  68. package/src/pnpm/write.js +1 -1
  69. package/src/soldeer/config.js +5 -9
  70. package/src/soldeer/tree.js +2 -4
  71. package/src/soldeer/zip.js +8 -17
  72. package/src/tarball.js +12 -29
  73. package/src/yarn1/compat.js +2 -4
  74. package/src/yarn1/hoist.js +3 -8
  75. package/src/yarn1/package.js +12 -23
  76. package/src/yarn1/resolve.js +6 -11
  77. package/src/yarn1/settings.js +5 -10
  78. package/src/yarn1/tree.js +9 -18
  79. package/yarn1.d.ts +203 -360
  80. package/yarn1.js +4 -6
package/cocoapods.d.ts CHANGED
@@ -1,420 +1,250 @@
1
- import type { Client } from '@preventive/upstream/github.js'
2
- import type { NodeType, Vfs } from '@preventive/vfs'
3
-
4
- export { LockfileError } from '@preventive/lockfile/cocoapods.js'
5
-
6
- // Where @preventive/upstream caches what it fetches, podspecs, GitHub's
7
- // tarballs and archives by :http among them. Each is fetched through it,
8
- // and that is the one place anything here touches a filesystem. Before the
9
- // network, it takes a podspec from CocoaPods' own spec repos, under
10
- // $CP_REPOS_DIR, else $CP_HOME_DIR/repos, else ~/.cocoapods/repos, where
11
- // one there has the lockfile's checksum, and writes none of it; then from
12
- // its own cache, where one is set, which is where it writes each it fetches
13
- // -- setCacheDir() sets the default one, and setCacheDir(false) unsets it;
14
- // unset, which it is until set, it writes nothing. CocoaPods' own download
15
- // cache is never read. The project is read only through the view given as
16
- // `project`, and the tree built in a Vfs.
17
- export { setCacheDir } from '@preventive/upstream/npm.js'
18
-
19
- // The machine CocoaPods would install on: `cocoapods` is the version that
20
- // installs, exact, 1.13.0 to 1.17.x, which download, clean and lock a pod
21
- // alike; `os` as Node names it -- `darwin` or `linux`. Windows is refused.
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
- cocoapods: string
24
- os: string
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
- // What the Podfile's targets are for, as CocoaPods names a platform.
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
- // A view of the project's root, by paths from `/`: a Vfs, or anything with
31
- // its readdir, lstat, stat and readFile, such as one of a directory on
32
- // disk, of which only Podfile.lock and the Podfile are read there: the
33
- // first of CocoaPods.podfile.yaml, CocoaPods.podfile, Podfile and
34
- // Podfile.rb that is a file, as CocoaPods looks for one; and, where no
35
- // `podspecs` are given, Pods/Local Podspecs/<name>.podspec.json for each
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
- // The files `pod install` reads at the project's root: Podfile.lock, and
47
- // the Podfile, whose sha1 PODFILE CHECKSUM has to be, as CocoaPods resolves
48
- // anew what a changed Podfile asks for. The Podfile is Ruby, and is not
49
- // read otherwise: what it says beyond which pods it asks for -- the
50
- // install! options, hooks, the targets and their platforms -- is not
51
- // known here, and is taken to be as below.
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
- // A download, or what is left of one, by paths from the pod's directory:
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, mode: number }>
138
- links: Map<string, string>
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
- command: string
145
- contents: CocoaPodsContents
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
- export interface CocoaPodsTreeGiven {
149
- lockfile: string
150
- podfile?: string | Uint8Array
151
- project?: undefined
152
- host: CocoaPodsHost
153
- platforms?: CocoaPodsPlatform[]
154
- podspecs?: Record<string, string | Uint8Array>
155
- manifest?: boolean
156
- partial?: boolean
157
- only?: string[]
158
- prepare?: (pod: CocoaPodsPrepare) => CocoaPodsContents | Promise<CocoaPodsContents>
159
- vfs?: Vfs
160
- github?: Client
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 CocoaPodsTreeRead {
164
- lockfile?: undefined
165
- podfile?: undefined
166
- project: CocoaPodsProject
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
- // What buildCocoaPodsTree counts, all of it plain numbers: `pods` the
179
- // lockfile's roots; `downloaded` those written into Pods/, each a podspec
180
- // and a tarball or an archive fetched, and the others those by :path, or
181
- // skipped;
182
- // `files` and `bytes` what is written, Manifest.lock among them, and
183
- // `links` the symlinks.
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
- pods: number
186
- downloaded: number
187
- files: number
188
- bytes: number
189
- links: number
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
- // A pod in the tree, as an SBOM would list it: `path` is its directory,
193
- // from the project's root, which is `/` of the Vfs -- Pods/<name>; `name`
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
- path: string
201
- name: string
202
- version: string
203
- checksum: string
204
- pods: string[]
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
- git: string
211
- commit: string
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
- http: string
218
- sha256: string
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
- // A pod `partial` skips: `name` and `version` the lockfile's, of the root;
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
- reason: string
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
- vfs: Vfs
235
- stats: CocoaPodsTreeStats
236
- installed: CocoaPodsInstalled[]
237
- skipped: CocoaPodsSkipped[]
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
- // The pods' directories `pod install` makes in Pods/ from the lockfile,
241
- // with host.cocoapods, in a project with no Pods directory yet, its
242
- // install! options at their defaults and no hook that changes what is
243
- // downloaded, CocoaPods' download cache used, as it is unless
244
- // COCOAPODS_SKIP_CACHE is set, and each pod in one pod target, as where
245
- // the Podfile's targets that use a pod ask for the same specs of it: where
246
- // they ask for others, CocoaPods makes a pod target of each, and makes the
247
- // source files of the first of them read-only alone, which is not followed,
248
- // as the lockfile has the specs of them all and not which target has
249
- // which. The project's path and the cache's, ~/Library/Caches/CocoaPods or
250
- // $CP_CACHE_DIR, are taken to have none of a glob's `*`, `?`, `[`, `]`, `{`
251
- // and `}`, and to be as NFKC normalizes them, as CocoaPods cleans a pod's
252
- // directory by its path as it is. Rooted at the project's root, it holds
253
- // Pods/<name> for each root CocoaPods downloads, but those `partial`
254
- // skips, and nothing else of the project; none at all where every pod is
255
- // by :path, as CocoaPods reads those where they are. What CocoaPods writes
256
- // beside them in Pods/ -- Manifest.lock, Local Podspecs, Headers, Target
257
- // Support Files, Pods.xcodeproj -- is not written, but Manifest.lock with
258
- // `manifest`, which is written whatever pods there are; nor is anything of
259
- // the user's project.
260
- //
261
- // Each root's podspec is fetched from trunk and held to the lockfile's
262
- // checksum, its sha1, with @preventive/upstream/cocoapods.js's getPodspec;
263
- // that of a pod by :podspec is `podspecs`', held to it alike. Its `source`
264
- // has to be a git repository on GitHub, by a full commit, or an archive by
265
- // :http, as below. A git source by a tag is refused: CocoaPods
266
- // records no commit for one, and GitHub can move it, so nothing would hold
267
- // what is downloaded to a hash. Of git, CocoaPods clones the repository and
268
- // checks the commit out, and here GitHub's tarball of the commit's tree is
269
- // fetched instead, by `github`: the tree read off the commit's own object,
270
- // which upstream's getCommitTree fetches from github.com as git fetches it
271
- // and holds to the commit's id, so that it is the commit's whatever
272
- // GitHub's API says; and the tarball, which getRepoTreeTarball holds to
273
- // that tree. A repository renamed or transferred since is fetched by the
274
- // name GitHub gives it now, as upstream's getRepo follows that redirect
275
- // with `followRedirect`. The checkout is as git writes one with no git
276
- // config and a umask of 0o022: each directory 0o755, each file 0o644, or
277
- // 0o755 where git has it executable; each symlink a symlink to its target;
278
- // a submodule an empty directory; a file the tree's .gitattributes mark
279
- // `eol=crlf` with CRLF, as upstream reads them. What git config on the
280
- // machine would change -- `core.autocrlf`, a filter such as Git LFS's -- is
281
- // not followed. GitHub's tarball is refused where upstream refuses it, and
282
- // where the tar reader of @preventive/archive/tar.js does, and so is a path
283
- // git refuses to check out: one with a `.git` in it, or its short name
284
- // `git~1`, in any case, dots and spaces after it, or a `:` after that. A
285
- // commit the podspec names has to be in the history of the repository's
286
- // default branch, as GitHub answers for a commit of any fork, and for one
287
- // no branch or tag reaches, which a clone does not have; one on another
288
- // branch alone is refused too.
289
- //
290
- // An archive by :http has to be on GitHub, over https: its URL
291
- // https://github.com/<owner>/<repo>/ and a path under it, such as GitHub's
292
- // archive of a tag, `archive/refs/tags/<tag>.tar.gz` or `.zip`, or a
293
- // release's asset; or in Meta's namespace on Maven Central, which React
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
- where: string | undefined
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
  }