npmdata 0.11.0 → 0.13.0
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/README.md +47 -42
- package/dist/cli/actions/check.d.ts +6 -0
- package/dist/cli/actions/check.d.ts.map +1 -0
- package/dist/cli/actions/check.js +45 -0
- package/dist/cli/actions/check.js.map +1 -0
- package/dist/cli/actions/extract.d.ts +7 -0
- package/dist/cli/actions/extract.d.ts.map +1 -0
- package/dist/cli/actions/extract.js +67 -0
- package/dist/cli/actions/extract.js.map +1 -0
- package/dist/cli/actions/init.d.ts +6 -0
- package/dist/cli/actions/init.d.ts.map +1 -0
- package/dist/cli/actions/init.js +30 -0
- package/dist/cli/actions/init.js.map +1 -0
- package/dist/cli/actions/list.d.ts +7 -0
- package/dist/cli/actions/list.d.ts.map +1 -0
- package/dist/cli/actions/list.js +36 -0
- package/dist/cli/actions/list.js.map +1 -0
- package/dist/cli/actions/purge.d.ts +6 -0
- package/dist/cli/actions/purge.d.ts.map +1 -0
- package/dist/cli/actions/purge.js +33 -0
- package/dist/cli/actions/purge.js.map +1 -0
- package/dist/cli/argv.d.ts +35 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +125 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +11 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/binpkg.d.ts +8 -0
- package/dist/cli/binpkg.d.ts.map +1 -0
- package/dist/cli/binpkg.js +24 -0
- package/dist/cli/binpkg.js.map +1 -0
- package/dist/cli/cli.d.ts +10 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +72 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/usage.d.ts +6 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +126 -0
- package/dist/cli/usage.js.map +1 -0
- package/dist/fileset/check.d.ts +15 -0
- package/dist/fileset/check.d.ts.map +1 -0
- package/dist/fileset/check.js +68 -0
- package/dist/fileset/check.js.map +1 -0
- package/dist/fileset/constants.d.ts +13 -0
- package/dist/fileset/constants.d.ts.map +1 -0
- package/dist/fileset/constants.js +22 -0
- package/dist/fileset/constants.js.map +1 -0
- package/dist/fileset/diff.d.ts +16 -0
- package/dist/fileset/diff.d.ts.map +1 -0
- package/dist/fileset/diff.js +116 -0
- package/dist/fileset/diff.js.map +1 -0
- package/dist/fileset/execute.d.ts +29 -0
- package/dist/fileset/execute.d.ts.map +1 -0
- package/dist/fileset/execute.js +136 -0
- package/dist/fileset/execute.js.map +1 -0
- package/dist/fileset/gitignore.d.ts +16 -0
- package/dist/fileset/gitignore.d.ts.map +1 -0
- package/dist/fileset/gitignore.js +82 -0
- package/dist/fileset/gitignore.js.map +1 -0
- package/dist/fileset/index.d.ts +5 -0
- package/dist/fileset/index.d.ts.map +1 -0
- package/dist/fileset/index.js +21 -0
- package/dist/fileset/index.js.map +1 -0
- package/dist/fileset/list.d.ts +6 -0
- package/dist/fileset/list.d.ts.map +1 -0
- package/dist/fileset/list.js +11 -0
- package/dist/fileset/list.js.map +1 -0
- package/dist/fileset/markers.d.ts +22 -0
- package/dist/fileset/markers.d.ts.map +1 -0
- package/dist/fileset/markers.js +68 -0
- package/dist/fileset/markers.js.map +1 -0
- package/dist/fileset/package-files.d.ts +14 -0
- package/dist/fileset/package-files.d.ts.map +1 -0
- package/dist/fileset/package-files.js +81 -0
- package/dist/fileset/package-files.js.map +1 -0
- package/dist/fileset/purge.d.ts +12 -0
- package/dist/fileset/purge.d.ts.map +1 -0
- package/dist/fileset/purge.js +95 -0
- package/dist/fileset/purge.js.map +1 -0
- package/dist/fileset/test-utils.d.ts +12 -0
- package/dist/fileset/test-utils.d.ts.map +1 -0
- package/dist/fileset/test-utils.js +65 -0
- package/dist/fileset/test-utils.js.map +1 -0
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -20
- package/dist/index.js.map +1 -1
- package/dist/npmdata-0.0.1.tgz +0 -0
- package/dist/package/action-check.d.ts +20 -0
- package/dist/package/action-check.d.ts.map +1 -0
- package/dist/package/action-check.js +61 -0
- package/dist/package/action-check.js.map +1 -0
- package/dist/package/action-extract.d.ts +21 -0
- package/dist/package/action-extract.d.ts.map +1 -0
- package/dist/package/action-extract.js +186 -0
- package/dist/package/action-extract.js.map +1 -0
- package/dist/package/action-init.d.ts +13 -0
- package/dist/package/action-init.d.ts.map +1 -0
- package/dist/package/action-init.js +77 -0
- package/dist/package/action-init.js.map +1 -0
- package/dist/package/action-list.d.ts +14 -0
- package/dist/package/action-list.d.ts.map +1 -0
- package/dist/package/action-list.js +46 -0
- package/dist/package/action-list.js.map +1 -0
- package/dist/package/action-purge.d.ts +21 -0
- package/dist/package/action-purge.d.ts.map +1 -0
- package/dist/package/action-purge.js +60 -0
- package/dist/package/action-purge.js.map +1 -0
- package/dist/package/config-merge.d.ts +18 -0
- package/dist/package/config-merge.d.ts.map +1 -0
- package/dist/package/config-merge.js +48 -0
- package/dist/package/config-merge.js.map +1 -0
- package/dist/package/config.d.ts +13 -0
- package/dist/package/config.d.ts.map +1 -0
- package/dist/package/config.js +29 -0
- package/dist/package/config.js.map +1 -0
- package/dist/package/content-replacements.d.ts +21 -0
- package/dist/package/content-replacements.d.ts.map +1 -0
- package/dist/package/content-replacements.js +96 -0
- package/dist/package/content-replacements.js.map +1 -0
- package/dist/package/index.d.ts +10 -0
- package/dist/package/index.d.ts.map +1 -0
- package/dist/package/index.js +16 -0
- package/dist/package/index.js.map +1 -0
- package/dist/package/symlinks.d.ts +17 -0
- package/dist/package/symlinks.d.ts.map +1 -0
- package/dist/package/symlinks.js +125 -0
- package/dist/package/symlinks.js.map +1 -0
- package/dist/types.d.ts +181 -277
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -12
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +25 -55
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +82 -181
- package/dist/utils.js.map +1 -1
- package/package.json +5 -3
- package/bin/npmdata.js +0 -4
- package/dist/cli.d.ts +0 -6
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -570
- package/dist/cli.js.map +0 -1
- package/dist/consumer.d.ts +0 -74
- package/dist/consumer.d.ts.map +0 -1
- package/dist/consumer.js +0 -820
- package/dist/consumer.js.map +0 -1
- package/dist/main.d.ts +0 -3
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -21
- package/dist/main.js.map +0 -1
- package/dist/publisher.d.ts +0 -38
- package/dist/publisher.d.ts.map +0 -1
- package/dist/publisher.js +0 -164
- package/dist/publisher.js.map +0 -1
- package/dist/runner.d.ts +0 -117
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js +0 -812
- package/dist/runner.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,344 +1,248 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Excludes common package metadata files that are not meant to be extracted by consumers.
|
|
2
|
+
* Internal parsed representation of an npm package specifier.
|
|
4
3
|
*/
|
|
5
|
-
export
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export type SymlinkConfig = {
|
|
12
|
-
/**
|
|
13
|
-
* Glob pattern relative to the extraction outputDir. Every file or directory
|
|
14
|
-
* whose relative path matches this pattern will be represented by a symlink in
|
|
15
|
-
* the target directory.
|
|
16
|
-
* Example: "**\/skills\/**" will find every entry under any "skills" directory.
|
|
17
|
-
*/
|
|
18
|
-
source: string;
|
|
19
|
-
/**
|
|
20
|
-
* Directory where the symlinks will be created, relative to the working
|
|
21
|
-
* directory in which the runner is invoked (i.e. the consumer's project root).
|
|
22
|
-
* Example: ".github/skills"
|
|
23
|
-
*/
|
|
24
|
-
target: string;
|
|
4
|
+
export type PackageConfig = {
|
|
5
|
+
/** npm package name (e.g. "my-pkg" or "@scope/my-pkg") */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Semver range constraint. Absent means "latest". */
|
|
8
|
+
version?: string;
|
|
25
9
|
};
|
|
26
10
|
/**
|
|
27
|
-
*
|
|
28
|
-
* After files are extracted, the specified files in the workspace are searched
|
|
29
|
-
* for regex matches and the matched portions are replaced with the target string.
|
|
11
|
+
* Controls which files are selected from a package and install behaviour.
|
|
30
12
|
*/
|
|
31
|
-
export type
|
|
32
|
-
/**
|
|
33
|
-
* Glob pattern (relative to the working directory) selecting workspace files
|
|
34
|
-
* whose content should be modified.
|
|
35
|
-
* Example: "docs/**\/*.md"
|
|
36
|
-
*/
|
|
37
|
-
files: string;
|
|
13
|
+
export type SelectorConfig = {
|
|
38
14
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* applied automatically).
|
|
42
|
-
* Example: "<!-- version: .* -->"
|
|
15
|
+
* Glob patterns; files must match at least one.
|
|
16
|
+
* Default: DEFAULT_FILENAME_PATTERNS (excludes package.json, bin/**, README.md, node_modules/**)
|
|
43
17
|
*/
|
|
44
|
-
|
|
18
|
+
files?: string[];
|
|
45
19
|
/**
|
|
46
|
-
*
|
|
47
|
-
* Example: "<!-- version: 1.2.3 -->"
|
|
20
|
+
* Regex strings; files must match at least one. Binary files always skip regex check.
|
|
48
21
|
*/
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Configuration for filtering which files to include/exclude
|
|
53
|
-
*/
|
|
54
|
-
export type FileFilterConfig = {
|
|
22
|
+
contentRegexes?: string[];
|
|
55
23
|
/**
|
|
56
|
-
*
|
|
24
|
+
* Tags this entry for --presets CLI filtering. Not forwarded to dependency packages.
|
|
57
25
|
*/
|
|
58
|
-
|
|
26
|
+
presets?: string[];
|
|
59
27
|
/**
|
|
60
|
-
*
|
|
28
|
+
* Force fresh package install even if a satisfying version is installed.
|
|
61
29
|
*/
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Event emitted by extract() as files are processed.
|
|
66
|
-
*/
|
|
67
|
-
export type ProgressEvent = {
|
|
68
|
-
type: 'package-start';
|
|
69
|
-
packageName: string;
|
|
70
|
-
packageVersion: string;
|
|
71
|
-
} | {
|
|
72
|
-
type: 'package-end';
|
|
73
|
-
packageName: string;
|
|
74
|
-
packageVersion: string;
|
|
75
|
-
} | {
|
|
76
|
-
type: 'file-added';
|
|
77
|
-
packageName: string;
|
|
78
|
-
file: string;
|
|
79
|
-
} | {
|
|
80
|
-
type: 'file-modified';
|
|
81
|
-
packageName: string;
|
|
82
|
-
file: string;
|
|
83
|
-
} | {
|
|
84
|
-
type: 'file-deleted';
|
|
85
|
-
packageName: string;
|
|
86
|
-
file: string;
|
|
87
|
-
} | {
|
|
88
|
-
type: 'file-skipped';
|
|
89
|
-
packageName: string;
|
|
90
|
-
file: string;
|
|
30
|
+
upgrade?: boolean;
|
|
91
31
|
};
|
|
92
32
|
/**
|
|
93
|
-
*
|
|
33
|
+
* Controls where and how extracted files are written.
|
|
94
34
|
*/
|
|
95
|
-
export type
|
|
96
|
-
/**
|
|
97
|
-
* Package specs to install from registry. Each entry is either a bare package name
|
|
98
|
-
* ("my-pkg") or a name with a semver constraint ("my-pkg@^1.2.3"). Multiple packages
|
|
99
|
-
* can be provided and they will all be extracted into outputDir.
|
|
100
|
-
*/
|
|
101
|
-
packages: string[];
|
|
102
|
-
/**
|
|
103
|
-
* Output directory where files will be extracted
|
|
104
|
-
*/
|
|
105
|
-
outputDir: string;
|
|
35
|
+
export type OutputConfig = {
|
|
106
36
|
/**
|
|
107
|
-
*
|
|
37
|
+
* Output directory relative to cwd. Concatenated across recursion levels.
|
|
108
38
|
*/
|
|
109
|
-
|
|
39
|
+
path: string;
|
|
110
40
|
/**
|
|
111
|
-
*
|
|
41
|
+
* Overwrite existing unmanaged files. Overridden by --force and --keep-existing.
|
|
112
42
|
*/
|
|
113
43
|
force?: boolean;
|
|
114
44
|
/**
|
|
115
|
-
*
|
|
116
|
-
* them when they are absent. Cannot be combined with force.
|
|
45
|
+
* Skip files that already exist; create missing ones. Cannot combine with force.
|
|
117
46
|
*/
|
|
118
47
|
keepExisting?: boolean;
|
|
119
48
|
/**
|
|
120
|
-
*
|
|
121
|
-
* Defaults to process.cwd() if not specified.
|
|
122
|
-
*/
|
|
123
|
-
cwd?: string;
|
|
124
|
-
/**
|
|
125
|
-
* Automatically create/update a .gitignore file alongside each .npmdata marker file,
|
|
126
|
-
* adding the managed files and the .npmdata file itself to be ignored by git.
|
|
127
|
-
* Defaults to true. Set to false to disable.
|
|
49
|
+
* Create/update .gitignore alongside each .npmdata marker.
|
|
128
50
|
*/
|
|
129
51
|
gitignore?: boolean;
|
|
130
52
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* this flag are not tracked by npmdata and can be freely edited by the user.
|
|
134
|
-
* When a destination file already exists it is left untouched and reported as
|
|
135
|
-
* skipped. Takes precedence over force.
|
|
53
|
+
* Write without .npmdata marker, no gitignore update, no read-only. Existing files skipped.
|
|
54
|
+
* Takes precedence over force.
|
|
136
55
|
*/
|
|
137
56
|
unmanaged?: boolean;
|
|
138
57
|
/**
|
|
139
|
-
*
|
|
140
|
-
* The returned ConsumerResult reflects what would have changed.
|
|
58
|
+
* Report what would change; no disk writes.
|
|
141
59
|
*/
|
|
142
60
|
dryRun?: boolean;
|
|
143
61
|
/**
|
|
144
|
-
*
|
|
145
|
-
* is already installed. Useful to pick up the latest patch or minor release.
|
|
146
|
-
*/
|
|
147
|
-
upgrade?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Optional callback called for each file event during extraction.
|
|
150
|
-
* Useful for progress reporting in scripts and build tools.
|
|
62
|
+
* Post-extract symlink operations. Appended across recursion levels.
|
|
151
63
|
*/
|
|
152
|
-
|
|
64
|
+
symlinks?: SymlinkConfig[];
|
|
153
65
|
/**
|
|
154
|
-
*
|
|
155
|
-
* When provided, check() will apply the same transformations to the package
|
|
156
|
-
* source content before comparing hashes, so files modified by replacements
|
|
157
|
-
* are not incorrectly reported as out of sync.
|
|
66
|
+
* Post-extract content replacements. Appended across recursion levels.
|
|
158
67
|
*/
|
|
159
68
|
contentReplacements?: ContentReplacementConfig[];
|
|
160
69
|
};
|
|
161
70
|
/**
|
|
162
|
-
*
|
|
71
|
+
* Controls runtime output verbosity.
|
|
163
72
|
*/
|
|
164
|
-
export type
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Package name that created this file
|
|
171
|
-
*/
|
|
172
|
-
packageName: string;
|
|
173
|
-
/**
|
|
174
|
-
* Package version that created this file
|
|
175
|
-
*/
|
|
176
|
-
packageVersion: string;
|
|
177
|
-
/**
|
|
178
|
-
* Whether the file was written replacing an existing unmanaged file (via force flag)
|
|
179
|
-
*/
|
|
180
|
-
force?: boolean;
|
|
73
|
+
export type ExecutionConfig = {
|
|
74
|
+
/** Suppress per-file output; print only final summary line. */
|
|
75
|
+
silent?: boolean;
|
|
76
|
+
/** Print detailed step information. */
|
|
77
|
+
verbose?: boolean;
|
|
181
78
|
};
|
|
182
79
|
/**
|
|
183
|
-
*
|
|
80
|
+
* Defines one post-extract symlink operation.
|
|
184
81
|
*/
|
|
185
|
-
export type
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
sourcePackages: Array<{
|
|
191
|
-
name: string;
|
|
192
|
-
version: string;
|
|
193
|
-
changes: {
|
|
194
|
-
added: string[];
|
|
195
|
-
modified: string[];
|
|
196
|
-
deleted: string[];
|
|
197
|
-
skipped: string[];
|
|
198
|
-
};
|
|
199
|
-
}>;
|
|
82
|
+
export type SymlinkConfig = {
|
|
83
|
+
/** Glob relative to outputDir. Matching files/dirs get symlinked into `target`. */
|
|
84
|
+
source: string;
|
|
85
|
+
/** Directory where symlinks are created, relative to outputDir. Supports ../ paths. */
|
|
86
|
+
target: string;
|
|
200
87
|
};
|
|
201
88
|
/**
|
|
202
|
-
*
|
|
89
|
+
* Defines one post-extract content replacement operation.
|
|
203
90
|
*/
|
|
204
|
-
export type
|
|
205
|
-
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
|
|
211
|
-
*/
|
|
212
|
-
differences: {
|
|
213
|
-
/**
|
|
214
|
-
* Files that are in the .npmdata marker but missing from the output directory
|
|
215
|
-
*/
|
|
216
|
-
missing: string[];
|
|
217
|
-
/**
|
|
218
|
-
* Files whose contents differ from the package source
|
|
219
|
-
*/
|
|
220
|
-
modified: string[];
|
|
221
|
-
/**
|
|
222
|
-
* Files that exist in the package but have not been extracted yet
|
|
223
|
-
*/
|
|
224
|
-
extra: string[];
|
|
225
|
-
};
|
|
226
|
-
/**
|
|
227
|
-
* Per-package breakdown of differences
|
|
228
|
-
*/
|
|
229
|
-
sourcePackages: Array<{
|
|
230
|
-
name: string;
|
|
231
|
-
version: string;
|
|
232
|
-
ok: boolean;
|
|
233
|
-
differences: {
|
|
234
|
-
missing: string[];
|
|
235
|
-
modified: string[];
|
|
236
|
-
extra: string[];
|
|
237
|
-
};
|
|
238
|
-
}>;
|
|
91
|
+
export type ContentReplacementConfig = {
|
|
92
|
+
/** Glob relative to cwd selecting workspace files to modify. */
|
|
93
|
+
files: string;
|
|
94
|
+
/** Regex string; all non-overlapping occurrences replaced (global flag applied). */
|
|
95
|
+
match: string;
|
|
96
|
+
/** Replacement string; may contain back-references ($1, $2). */
|
|
97
|
+
replace: string;
|
|
239
98
|
};
|
|
240
99
|
/**
|
|
241
|
-
*
|
|
242
|
-
* The runner iterates over these entries and calls extract() for each one.
|
|
100
|
+
* One entry in the npmdata.sets array. Represents a single extraction target.
|
|
243
101
|
*/
|
|
244
102
|
export type NpmdataExtractEntry = {
|
|
245
|
-
/**
|
|
246
|
-
* Package spec to install and extract from. Either a bare name ("my-pkg") or a
|
|
247
|
-
* name with a semver constraint ("my-pkg@^1.2.3").
|
|
248
|
-
*/
|
|
103
|
+
/** Flat package spec string ("my-pkg@^1.2.3"). Parsed to PackageConfig internally. */
|
|
249
104
|
package: string;
|
|
105
|
+
/** Where/how to write files. */
|
|
106
|
+
output: OutputConfig;
|
|
107
|
+
/** Which files to select and install options. */
|
|
108
|
+
selector?: SelectorConfig;
|
|
250
109
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
|
|
254
|
-
outputDir: string;
|
|
255
|
-
/**
|
|
256
|
-
* Glob patterns to filter which files are extracted (e.g. ["data/**", "*.json"]).
|
|
257
|
-
* Defaults to all files when not set.
|
|
258
|
-
*/
|
|
259
|
-
files?: string[];
|
|
260
|
-
/**
|
|
261
|
-
* Allow overwriting existing unmanaged files (default: false).
|
|
262
|
-
*/
|
|
263
|
-
force?: boolean;
|
|
264
|
-
/**
|
|
265
|
-
* When true, skip files that already exist in the output directory but create
|
|
266
|
-
* them when they are absent. Cannot be combined with force (default: false).
|
|
267
|
-
*/
|
|
268
|
-
keepExisting?: boolean;
|
|
269
|
-
/**
|
|
270
|
-
* Create/update a .gitignore file alongside each .npmdata marker file (default: true).
|
|
271
|
-
*/
|
|
272
|
-
gitignore?: boolean;
|
|
273
|
-
/**
|
|
274
|
-
* Write files without creating a .npmdata marker, updating .gitignore, or making
|
|
275
|
-
* files read-only. Existing files are skipped rather than overwritten (default: false).
|
|
276
|
-
*/
|
|
277
|
-
unmanaged?: boolean;
|
|
278
|
-
/**
|
|
279
|
-
* Simulate extraction without writing anything to disk (default: false).
|
|
280
|
-
*/
|
|
281
|
-
dryRun?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* Force a fresh install of the package even when a satisfying version is already
|
|
284
|
-
* installed (default: false).
|
|
285
|
-
*/
|
|
286
|
-
upgrade?: boolean;
|
|
287
|
-
/**
|
|
288
|
-
* Suppress per-file output, printing only the final result line (default: false).
|
|
110
|
+
* Preset tags for --presets CLI filtering. An entry is included when at least
|
|
111
|
+
* one of its presets appears in the requested preset list.
|
|
112
|
+
* Not forwarded to dependency packages.
|
|
289
113
|
*/
|
|
114
|
+
presets?: string[];
|
|
115
|
+
/** Suppress per-file output. Root-level (not nested). */
|
|
290
116
|
silent?: boolean;
|
|
291
|
-
/**
|
|
292
|
-
* Print detailed progress information for each file and step processed (default: false).
|
|
293
|
-
*/
|
|
117
|
+
/** Print detailed step information. Root-level (not nested). */
|
|
294
118
|
verbose?: boolean;
|
|
295
|
-
/**
|
|
296
|
-
* Regex patterns (as strings) to filter files by content. Only files whose content
|
|
297
|
-
* matches at least one pattern are extracted.
|
|
298
|
-
*/
|
|
299
|
-
contentRegexes?: string[];
|
|
300
|
-
/**
|
|
301
|
-
* Tags used to group and selectively run entries. When the data package is invoked with
|
|
302
|
-
* --tags, only entries whose tags list includes at least one of the requested tags are
|
|
303
|
-
* processed. Entries with no tags are always skipped when a tag filter is active.
|
|
304
|
-
*/
|
|
305
|
-
tags?: string[];
|
|
306
|
-
/**
|
|
307
|
-
* Post-extract symlink operations. After extraction, for each config the runner
|
|
308
|
-
* resolves all files/directories inside outputDir that match the source glob and
|
|
309
|
-
* creates a corresponding symlink inside the target directory. Stale symlinks
|
|
310
|
-
* (pointing into outputDir but no longer matched) are removed automatically.
|
|
311
|
-
*/
|
|
312
|
-
symlinks?: SymlinkConfig[];
|
|
313
|
-
/**
|
|
314
|
-
* Post-extract content-replacement operations. After extraction, for each config
|
|
315
|
-
* the runner finds workspace files matching the files glob and applies the regex
|
|
316
|
-
* replacement to their contents.
|
|
317
|
-
*/
|
|
318
|
-
contentReplacements?: ContentReplacementConfig[];
|
|
319
119
|
};
|
|
320
120
|
/**
|
|
321
|
-
* Top-level
|
|
322
|
-
* or in a .npmdatarc file.
|
|
121
|
+
* Top-level structure stored under npmdata key in package.json or in any cosmiconfig source.
|
|
323
122
|
*/
|
|
324
123
|
export type NpmdataConfig = {
|
|
124
|
+
/** All extraction entries. */
|
|
125
|
+
sets: NpmdataExtractEntry[];
|
|
325
126
|
/**
|
|
326
|
-
*
|
|
127
|
+
* Shell command run after successful extract (not during --dry-run).
|
|
128
|
+
* Executed in process.cwd(). Full argv appended as arguments.
|
|
327
129
|
*/
|
|
328
|
-
|
|
130
|
+
postExtractScript?: string;
|
|
329
131
|
};
|
|
330
132
|
/**
|
|
331
|
-
*
|
|
133
|
+
* A single file operation in the diff/execute pipeline.
|
|
332
134
|
*/
|
|
333
|
-
export type
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
135
|
+
export type FileOperation = {
|
|
136
|
+
relPath: string;
|
|
137
|
+
sourcePath: string;
|
|
138
|
+
destPath: string;
|
|
139
|
+
hash: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* A file skipped during extraction with the reason.
|
|
143
|
+
*/
|
|
144
|
+
export type SkippedFile = {
|
|
145
|
+
relPath: string;
|
|
146
|
+
reason: 'conflict' | 'keep-existing' | 'unmanaged';
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* An unmanaged file in outputDir that blocks extraction.
|
|
150
|
+
*/
|
|
151
|
+
export type ConflictFile = {
|
|
152
|
+
relPath: string;
|
|
153
|
+
/** Set when file is managed by a different package. */
|
|
154
|
+
existingOwner?: string;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Internal read-only structure produced by fileset/diff.ts. Not persisted.
|
|
158
|
+
*/
|
|
159
|
+
export type ExtractionMap = {
|
|
160
|
+
/** Files present in package source but absent from outputDir. */
|
|
161
|
+
toAdd: FileOperation[];
|
|
162
|
+
/** Files whose hash differs between package source and outputDir. */
|
|
163
|
+
toModify: FileOperation[];
|
|
164
|
+
/** Relative paths of managed files no longer present in filtered package source. */
|
|
165
|
+
toDelete: string[];
|
|
166
|
+
/** Files skipped with reason. */
|
|
167
|
+
toSkip: SkippedFile[];
|
|
168
|
+
/** Unmanaged files in outputDir that block extraction. */
|
|
169
|
+
conflicts: ConflictFile[];
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* One row in a .npmdata CSV marker file.
|
|
173
|
+
* CSV format (preserved from v1): path,packageName,packageVersion — one row per file, no header.
|
|
174
|
+
*/
|
|
175
|
+
export type ManagedFileMetadata = {
|
|
176
|
+
/** Relative path from marker file directory. */
|
|
177
|
+
path: string;
|
|
178
|
+
/** Source npm package name. */
|
|
179
|
+
packageName: string;
|
|
180
|
+
/** Installed version at extraction time. */
|
|
181
|
+
packageVersion: string;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Event emitted by extract/check/purge for UI progress reporting.
|
|
185
|
+
*/
|
|
186
|
+
export type ProgressEvent = {
|
|
187
|
+
type: 'package-start';
|
|
188
|
+
packageName: string;
|
|
189
|
+
packageVersion: string;
|
|
190
|
+
} | {
|
|
191
|
+
type: 'package-end';
|
|
192
|
+
packageName: string;
|
|
193
|
+
packageVersion: string;
|
|
194
|
+
} | {
|
|
195
|
+
type: 'file-added';
|
|
196
|
+
packageName: string;
|
|
197
|
+
file: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'file-modified';
|
|
200
|
+
packageName: string;
|
|
201
|
+
file: string;
|
|
202
|
+
} | {
|
|
203
|
+
type: 'file-deleted';
|
|
204
|
+
packageName: string;
|
|
205
|
+
file: string;
|
|
206
|
+
} | {
|
|
207
|
+
type: 'file-skipped';
|
|
208
|
+
packageName: string;
|
|
209
|
+
file: string;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Result of a check operation for a single fileset.
|
|
213
|
+
*/
|
|
214
|
+
export type CheckResult = {
|
|
215
|
+
/** Files in .npmdata marker but absent from output dir. */
|
|
216
|
+
missing: string[];
|
|
217
|
+
/** Files whose content hash differs from package source. */
|
|
218
|
+
modified: string[];
|
|
219
|
+
/** Files in filtered package source but never extracted. */
|
|
220
|
+
extra: string[];
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Result of purging one fileset.
|
|
224
|
+
*/
|
|
225
|
+
export type PurgeResult = {
|
|
226
|
+
/** Number of files deleted. */
|
|
227
|
+
deleted: number;
|
|
228
|
+
/** Number of symlinks removed. */
|
|
229
|
+
symlinksRemoved: number;
|
|
230
|
+
/** Number of empty dirs removed. */
|
|
231
|
+
dirsRemoved: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Result of executing an ExtractionMap.
|
|
235
|
+
*/
|
|
236
|
+
export type ExecuteResult = {
|
|
237
|
+
/** Paths of newly created files (for rollback purposes). */
|
|
238
|
+
newlyCreated: string[];
|
|
239
|
+
/** Number of files added. */
|
|
240
|
+
added: number;
|
|
241
|
+
/** Number of files modified. */
|
|
242
|
+
modified: number;
|
|
243
|
+
/** Number of files deleted. */
|
|
244
|
+
deleted: number;
|
|
245
|
+
/** Number of files skipped. */
|
|
246
|
+
skipped: number;
|
|
343
247
|
};
|
|
344
248
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB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M,CAAC;CACjB,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_FILENAME_PATTERNS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Default filename patterns applied when no filenamePatterns are specified.
|
|
6
|
-
* Excludes common package metadata files that are not meant to be extracted by consumers.
|
|
7
|
-
*/
|
|
8
|
-
exports.DEFAULT_FILENAME_PATTERNS = [
|
|
9
|
-
'**',
|
|
10
|
-
'!package.json',
|
|
11
|
-
'!bin/**',
|
|
12
|
-
'!README.md',
|
|
13
|
-
'!node_modules/**',
|
|
14
|
-
];
|
|
15
3
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|