npm-pkgbuild 15.6.11 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -23
- package/README.md +247 -170
- package/package.json +19 -19
- package/src/content/content-provider.mjs +3 -13
- package/src/content/file-content-provider.mjs +1 -1
- package/src/content/node-modules-content-provider.mjs +3 -2
- package/src/content/npm-pack-content-provider.mjs +3 -0
- package/src/output/arch.mjs +12 -2
- package/src/util.mjs +1 -3
- package/types/content/content-provider.d.mts +0 -4
- package/types/content/node-modules-content-provider.d.mts +0 -2
- package/types/output/arch.d.mts +1 -0
package/LICENSE
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
Copyright (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
17
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
18
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
20
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
21
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
22
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
23
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
Copyright (C) 2018-2025 by arlac77
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted.
|
|
5
|
+
|
|
6
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
8
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
9
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
10
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
11
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/npm-pkgbuild)
|
|
2
|
-
[](https://spdx.org/licenses/0BSD.html)
|
|
3
3
|
[](https://typescriptlang.org)
|
|
4
4
|
[](https://bundlejs.com/?q=npm-pkgbuild)
|
|
5
5
|
[](https://npmjs.org/package/npm-pkgbuild)
|
|
@@ -90,200 +90,197 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
90
90
|
|
|
91
91
|
### Table of Contents
|
|
92
92
|
|
|
93
|
-
* [
|
|
93
|
+
* [allInputs](#allinputs)
|
|
94
|
+
* [allOutputs](#alloutputs)
|
|
95
|
+
* [npmArchMapping](#npmarchmapping)
|
|
96
|
+
* [content2Sources](#content2sources)
|
|
94
97
|
* [Parameters](#parameters)
|
|
98
|
+
* [PackageDefinition](#packagedefinition)
|
|
95
99
|
* [Properties](#properties)
|
|
96
|
-
|
|
97
|
-
* [asyncIterator](#asynciterator)
|
|
98
|
-
* [FileContentProvider](#filecontentprovider)
|
|
100
|
+
* [extractFromPackage](#extractfrompackage)
|
|
99
101
|
* [Parameters](#parameters-1)
|
|
100
|
-
|
|
101
|
-
* [utf8StreamOptions](#utf8streamoptions)
|
|
102
|
-
* [Properties](#properties-1)
|
|
103
|
-
* [decodePassword](#decodepassword)
|
|
102
|
+
* [NPMPackContentProvider](#npmpackcontentprovider)
|
|
104
103
|
* [Parameters](#parameters-2)
|
|
105
|
-
* [
|
|
106
|
-
* [
|
|
107
|
-
* [
|
|
104
|
+
* [Properties](#properties-1)
|
|
105
|
+
* [name](#name)
|
|
106
|
+
* [FileContentProvider](#filecontentprovider)
|
|
108
107
|
* [Parameters](#parameters-3)
|
|
109
|
-
* [fieldProvider](#fieldprovider)
|
|
110
|
-
* [Parameters](#parameters-4)
|
|
111
|
-
* [Expander](#expander)
|
|
112
|
-
* [Parameters](#parameters-5)
|
|
113
|
-
* [copyEntries](#copyentries)
|
|
114
|
-
* [Parameters](#parameters-6)
|
|
115
|
-
* [NFTContentProvider](#nftcontentprovider)
|
|
116
|
-
* [Parameters](#parameters-7)
|
|
117
108
|
* [name](#name-1)
|
|
118
|
-
* [
|
|
119
|
-
* [Parameters](#parameters-
|
|
120
|
-
* [Properties](#properties-3)
|
|
109
|
+
* [NFTContentProvider](#nftcontentprovider)
|
|
110
|
+
* [Parameters](#parameters-4)
|
|
121
111
|
* [name](#name-2)
|
|
122
|
-
* [
|
|
123
|
-
* [Parameters](#parameters-
|
|
124
|
-
* [Properties](#properties-
|
|
125
|
-
* [
|
|
126
|
-
* [
|
|
127
|
-
* [fields](#fields)
|
|
128
|
-
* [fields](#fields-1)
|
|
129
|
-
* [fields](#fields-2)
|
|
130
|
-
* [fields](#fields-3)
|
|
131
|
-
* [BUILDAH](#buildah)
|
|
112
|
+
* [ContentProvider](#contentprovider)
|
|
113
|
+
* [Parameters](#parameters-5)
|
|
114
|
+
* [Properties](#properties-2)
|
|
115
|
+
* [destinationPrefix](#destinationprefix)
|
|
116
|
+
* [asyncIterator](#asynciterator)
|
|
132
117
|
* [hookMapping](#hookmapping)
|
|
133
118
|
* [hookMapping](#hookmapping-1)
|
|
134
119
|
* [DEBIAN](#debian)
|
|
135
120
|
* [prepare](#prepare)
|
|
136
|
-
* [Parameters](#parameters-
|
|
137
|
-
* [
|
|
121
|
+
* [Parameters](#parameters-6)
|
|
122
|
+
* [fields](#fields)
|
|
123
|
+
* [fields](#fields-1)
|
|
124
|
+
* [fields](#fields-2)
|
|
125
|
+
* [fields](#fields-3)
|
|
126
|
+
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
127
|
+
* [quoteFile](#quotefile)
|
|
128
|
+
* [Parameters](#parameters-7)
|
|
129
|
+
* [RPM](#rpm)
|
|
138
130
|
* [prepare](#prepare-1)
|
|
139
|
-
* [Parameters](#parameters-
|
|
131
|
+
* [Parameters](#parameters-8)
|
|
140
132
|
* [OCI](#oci)
|
|
133
|
+
* [DOCKER](#docker)
|
|
134
|
+
* [prepare](#prepare-2)
|
|
135
|
+
* [Parameters](#parameters-9)
|
|
136
|
+
* [BUILDAH](#buildah)
|
|
137
|
+
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
138
|
+
* [Parameters](#parameters-10)
|
|
139
|
+
* [Properties](#properties-3)
|
|
140
|
+
* [name](#name-3)
|
|
141
141
|
* [Packager](#packager)
|
|
142
|
-
* [Parameters](#parameters-
|
|
142
|
+
* [Parameters](#parameters-11)
|
|
143
143
|
* [packageName](#packagename)
|
|
144
|
-
* [Parameters](#parameters-
|
|
144
|
+
* [Parameters](#parameters-12)
|
|
145
145
|
* [tmpdir](#tmpdir)
|
|
146
|
-
* [prepare](#prepare-
|
|
147
|
-
* [Parameters](#parameters-
|
|
146
|
+
* [prepare](#prepare-3)
|
|
147
|
+
* [Parameters](#parameters-13)
|
|
148
148
|
* [create](#create)
|
|
149
|
-
* [Parameters](#parameters-
|
|
149
|
+
* [Parameters](#parameters-14)
|
|
150
150
|
* [workspaceLayout](#workspacelayout)
|
|
151
|
-
* [prepare](#prepare-
|
|
152
|
-
* [Parameters](#parameters-
|
|
151
|
+
* [prepare](#prepare-4)
|
|
152
|
+
* [Parameters](#parameters-15)
|
|
153
153
|
* [Packager](#packager-1)
|
|
154
|
-
* [Parameters](#parameters-
|
|
154
|
+
* [Parameters](#parameters-16)
|
|
155
155
|
* [packageName](#packagename-1)
|
|
156
|
-
* [Parameters](#parameters-
|
|
156
|
+
* [Parameters](#parameters-17)
|
|
157
157
|
* [tmpdir](#tmpdir-1)
|
|
158
|
-
* [prepare](#prepare-
|
|
159
|
-
* [Parameters](#parameters-
|
|
158
|
+
* [prepare](#prepare-5)
|
|
159
|
+
* [Parameters](#parameters-18)
|
|
160
160
|
* [create](#create-1)
|
|
161
|
-
* [Parameters](#parameters-
|
|
161
|
+
* [Parameters](#parameters-19)
|
|
162
162
|
* [workspaceLayout](#workspacelayout-1)
|
|
163
|
-
* [prepare](#prepare-
|
|
164
|
-
* [Parameters](#parameters-
|
|
163
|
+
* [prepare](#prepare-6)
|
|
164
|
+
* [Parameters](#parameters-20)
|
|
165
165
|
* [Field](#field)
|
|
166
|
-
* [Properties](#properties-
|
|
166
|
+
* [Properties](#properties-4)
|
|
167
|
+
* [copyNodeModules](#copynodemodules)
|
|
168
|
+
* [Parameters](#parameters-21)
|
|
167
169
|
* [PublishingDetail](#publishingdetail)
|
|
168
|
-
* [Properties](#properties-
|
|
170
|
+
* [Properties](#properties-5)
|
|
169
171
|
* [createPublishingDetails](#createpublishingdetails)
|
|
170
172
|
* [Parameters](#parameters-22)
|
|
171
173
|
* [publish](#publish)
|
|
172
174
|
* [Parameters](#parameters-23)
|
|
173
|
-
* [
|
|
175
|
+
* [utf8StreamOptions](#utf8streamoptions)
|
|
176
|
+
* [Properties](#properties-6)
|
|
177
|
+
* [decodePassword](#decodepassword)
|
|
174
178
|
* [Parameters](#parameters-24)
|
|
175
|
-
* [
|
|
176
|
-
* [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
* `definitions`  
|
|
186
|
-
* `entryProperties`  
|
|
187
|
-
|
|
188
|
-
### Properties
|
|
189
|
-
|
|
190
|
-
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
191
|
-
* `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<Transformer>** 
|
|
179
|
+
* [FunctionDecl](#functiondecl)
|
|
180
|
+
* [Properties](#properties-7)
|
|
181
|
+
* [extractFunctions](#extractfunctions)
|
|
182
|
+
* [Parameters](#parameters-25)
|
|
183
|
+
* [fieldProvider](#fieldprovider)
|
|
184
|
+
* [Parameters](#parameters-26)
|
|
185
|
+
* [Expander](#expander)
|
|
186
|
+
* [Parameters](#parameters-27)
|
|
187
|
+
* [copyEntries](#copyentries)
|
|
188
|
+
* [Parameters](#parameters-28)
|
|
192
189
|
|
|
193
|
-
|
|
190
|
+
## allInputs
|
|
194
191
|
|
|
195
|
-
|
|
192
|
+
All content providers (input)
|
|
196
193
|
|
|
197
|
-
|
|
194
|
+
## allOutputs
|
|
198
195
|
|
|
199
|
-
|
|
196
|
+
All output formats
|
|
200
197
|
|
|
201
|
-
|
|
198
|
+
## npmArchMapping
|
|
202
199
|
|
|
203
|
-
|
|
200
|
+
Node architecture name to os native arch name mapping
|
|
201
|
+
{@see <https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processargv}>
|
|
204
202
|
|
|
205
|
-
|
|
203
|
+
## content2Sources
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
Delivers ContentProviders from pkgbuild.content definition.
|
|
208
206
|
|
|
209
207
|
### Parameters
|
|
210
208
|
|
|
211
|
-
* `
|
|
209
|
+
* `content` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** from pkgbuild.content
|
|
210
|
+
* `dir`  
|
|
212
211
|
|
|
213
|
-
|
|
214
|
-
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
215
|
-
* `entryProperties`  
|
|
212
|
+
Returns **Iterable<[ContentProvider](#contentprovider)>** 
|
|
216
213
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
220
|
-
|
|
221
|
-
## utf8StreamOptions
|
|
214
|
+
## PackageDefinition
|
|
222
215
|
|
|
223
216
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
224
217
|
|
|
225
218
|
### Properties
|
|
226
219
|
|
|
227
|
-
* `
|
|
220
|
+
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** values describing the package attributes
|
|
221
|
+
* `sources` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[ContentProvider](#contentprovider)>** content providers
|
|
222
|
+
* `dependencies` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
223
|
+
* `output` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** package type
|
|
224
|
+
* `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** identifier of the variant
|
|
228
225
|
|
|
229
|
-
|
|
226
|
+
* `variant.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the variant
|
|
227
|
+
* `variant.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the architecture
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
## extractFromPackage
|
|
232
230
|
|
|
233
|
-
|
|
231
|
+
Extract package definition from package.json.
|
|
234
232
|
|
|
235
|
-
*
|
|
233
|
+
* for each architecture deliver a new result
|
|
234
|
+
* if no architecture is given one result set is provided nethertheless
|
|
235
|
+
* architectures are taken from cpu (node arch ids) and from pkgbuild.arch (raw arch ids)
|
|
236
|
+
* architecture given in a variant definition are used to restrict the set of avaliable architectures
|
|
236
237
|
|
|
237
|
-
|
|
238
|
+
### Parameters
|
|
238
239
|
|
|
239
|
-
|
|
240
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
* `options.dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** where to look for package.json
|
|
243
|
+
* `options.verbose` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** log
|
|
244
|
+
* `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as delared in process.env (optional, default `{}`)
|
|
242
245
|
|
|
243
|
-
|
|
246
|
+
Returns **AsyncIterable<[PackageDefinition](#packagedefinition)>** 
|
|
244
247
|
|
|
245
|
-
|
|
246
|
-
* `body` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
248
|
+
## NPMPackContentProvider
|
|
247
249
|
|
|
248
|
-
|
|
250
|
+
**Extends ContentProvider**
|
|
249
251
|
|
|
250
|
-
|
|
252
|
+
Content from npm pack.
|
|
251
253
|
|
|
252
254
|
### Parameters
|
|
253
255
|
|
|
254
|
-
* `
|
|
256
|
+
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
257
|
+
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
|
|
255
258
|
|
|
256
|
-
|
|
259
|
+
### Properties
|
|
257
260
|
|
|
258
|
-
|
|
261
|
+
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
259
262
|
|
|
260
|
-
###
|
|
263
|
+
### name
|
|
261
264
|
|
|
262
|
-
|
|
263
|
-
* `fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
265
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
264
266
|
|
|
265
|
-
|
|
267
|
+
## FileContentProvider
|
|
266
268
|
|
|
267
|
-
|
|
269
|
+
**Extends ContentProvider**
|
|
268
270
|
|
|
269
|
-
|
|
271
|
+
Content provided form the file system.
|
|
270
272
|
|
|
271
273
|
### Parameters
|
|
272
274
|
|
|
273
|
-
* `
|
|
274
|
-
|
|
275
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
276
|
-
|
|
277
|
-
## copyEntries
|
|
275
|
+
* `definitions` **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** 
|
|
278
276
|
|
|
279
|
-
|
|
280
|
-
|
|
277
|
+
* `definitions.pattern` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>)** 
|
|
278
|
+
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
279
|
+
* `entryProperties`  
|
|
281
280
|
|
|
282
|
-
###
|
|
281
|
+
### name
|
|
283
282
|
|
|
284
|
-
|
|
285
|
-
* `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
286
|
-
* `expander` **[Expander](#expander)** (optional, default `v=>v`)
|
|
283
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
287
284
|
|
|
288
285
|
## NFTContentProvider
|
|
289
286
|
|
|
@@ -303,12 +300,9 @@ Content provided form the file system.
|
|
|
303
300
|
|
|
304
301
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
305
302
|
|
|
306
|
-
##
|
|
307
|
-
|
|
308
|
-
**Extends ContentProvider**
|
|
303
|
+
## ContentProvider
|
|
309
304
|
|
|
310
|
-
|
|
311
|
-
Requires .npmrc or NPM\_TOKEN environment
|
|
305
|
+
Source of package content.
|
|
312
306
|
|
|
313
307
|
### Parameters
|
|
314
308
|
|
|
@@ -317,40 +311,43 @@ Requires .npmrc or NPM\_TOKEN environment
|
|
|
317
311
|
|
|
318
312
|
### Properties
|
|
319
313
|
|
|
320
|
-
* `
|
|
321
|
-
* `
|
|
314
|
+
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
315
|
+
* `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<Transformer>** 
|
|
322
316
|
|
|
323
|
-
###
|
|
317
|
+
### destinationPrefix
|
|
324
318
|
|
|
325
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
319
|
+
Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
|
|
326
320
|
|
|
327
|
-
|
|
321
|
+
### asyncIterator
|
|
328
322
|
|
|
329
|
-
|
|
323
|
+
List all entries.
|
|
330
324
|
|
|
331
|
-
|
|
325
|
+
Returns **AsyncIterable\<ContentEntry>** all entries
|
|
332
326
|
|
|
333
|
-
|
|
327
|
+
## hookMapping
|
|
334
328
|
|
|
335
|
-
|
|
336
|
-
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
|
|
329
|
+
map install hook named from arch to deb
|
|
337
330
|
|
|
338
|
-
|
|
331
|
+
## hookMapping
|
|
339
332
|
|
|
340
|
-
|
|
333
|
+
map install hook named from arch to rpm
|
|
341
334
|
|
|
342
|
-
|
|
335
|
+
## DEBIAN
|
|
343
336
|
|
|
344
|
-
|
|
337
|
+
**Extends Packager**
|
|
345
338
|
|
|
346
|
-
|
|
339
|
+
Create .deb packages
|
|
347
340
|
|
|
348
|
-
|
|
341
|
+
### prepare
|
|
349
342
|
|
|
350
|
-
|
|
343
|
+
#### Parameters
|
|
351
344
|
|
|
352
|
-
|
|
353
|
-
|
|
345
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
346
|
+
* `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
347
|
+
|
|
348
|
+
* `variant.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
349
|
+
|
|
350
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>** 
|
|
354
351
|
|
|
355
352
|
## fields
|
|
356
353
|
|
|
@@ -359,34 +356,37 @@ well known package properties
|
|
|
359
356
|
|
|
360
357
|
## fields
|
|
361
358
|
|
|
362
|
-
|
|
359
|
+
well known package properties
|
|
360
|
+
<https://www.archlinux.org/pacman/PKGBUILD.5.html>
|
|
363
361
|
|
|
364
362
|
## fields
|
|
365
363
|
|
|
366
364
|
* **See**: <https://rpm-packaging-guide.github.io>
|
|
367
365
|
|
|
368
|
-
##
|
|
366
|
+
## fields
|
|
369
367
|
|
|
370
|
-
**
|
|
368
|
+
* **See**: <https://docs.docker.com/engine/reference/builder/>
|
|
371
369
|
|
|
372
|
-
|
|
370
|
+
## pkgKeyValuePairOptions
|
|
373
371
|
|
|
374
|
-
|
|
372
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
375
373
|
|
|
376
|
-
|
|
374
|
+
## quoteFile
|
|
377
375
|
|
|
378
|
-
|
|
376
|
+
### Parameters
|
|
379
377
|
|
|
380
|
-
|
|
378
|
+
* `name`  
|
|
381
379
|
|
|
382
|
-
##
|
|
380
|
+
## RPM
|
|
383
381
|
|
|
384
382
|
**Extends Packager**
|
|
385
383
|
|
|
386
|
-
|
|
384
|
+
produce rpm packages
|
|
387
385
|
|
|
388
386
|
### prepare
|
|
389
387
|
|
|
388
|
+
Check for rpmbuild presence.
|
|
389
|
+
|
|
390
390
|
#### Parameters
|
|
391
391
|
|
|
392
392
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
@@ -394,7 +394,13 @@ Create .deb packages
|
|
|
394
394
|
|
|
395
395
|
* `variant.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
396
396
|
|
|
397
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
397
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>** true when rpmbuild executable is present
|
|
398
|
+
|
|
399
|
+
## OCI
|
|
400
|
+
|
|
401
|
+
**Extends Packager**
|
|
402
|
+
|
|
403
|
+
Low level OCI compatible packager
|
|
398
404
|
|
|
399
405
|
## DOCKER
|
|
400
406
|
|
|
@@ -415,11 +421,32 @@ Check for docker presence.
|
|
|
415
421
|
|
|
416
422
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>** true when docker executable is present
|
|
417
423
|
|
|
418
|
-
##
|
|
424
|
+
## BUILDAH
|
|
419
425
|
|
|
420
|
-
**Extends
|
|
426
|
+
**Extends DOCKER**
|
|
421
427
|
|
|
422
|
-
|
|
428
|
+
Use buildah @see <https://buildah.io>
|
|
429
|
+
|
|
430
|
+
## NodeModulesContentProvider
|
|
431
|
+
|
|
432
|
+
**Extends ContentProvider**
|
|
433
|
+
|
|
434
|
+
Content from node\_modules.
|
|
435
|
+
Requires .npmrc or NPM\_TOKEN environment
|
|
436
|
+
|
|
437
|
+
### Parameters
|
|
438
|
+
|
|
439
|
+
* `definitions`  
|
|
440
|
+
* `entryProperties`  
|
|
441
|
+
|
|
442
|
+
### Properties
|
|
443
|
+
|
|
444
|
+
* `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
445
|
+
* `destinationPrefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base name out output
|
|
446
|
+
|
|
447
|
+
### name
|
|
448
|
+
|
|
449
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
423
450
|
|
|
424
451
|
## Packager
|
|
425
452
|
|
|
@@ -556,6 +583,14 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
556
583
|
* `default` **any** 
|
|
557
584
|
* `mandatory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
558
585
|
|
|
586
|
+
## copyNodeModules
|
|
587
|
+
|
|
588
|
+
### Parameters
|
|
589
|
+
|
|
590
|
+
* `source` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
591
|
+
* `dest` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
592
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `defaultOptions`)
|
|
593
|
+
|
|
559
594
|
## PublishingDetail
|
|
560
595
|
|
|
561
596
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
@@ -592,30 +627,72 @@ Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Gl
|
|
|
592
627
|
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
593
628
|
* `logger` **function (any): void** (optional, default `console.log`)
|
|
594
629
|
|
|
595
|
-
##
|
|
630
|
+
## utf8StreamOptions
|
|
631
|
+
|
|
632
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
633
|
+
|
|
634
|
+
### Properties
|
|
635
|
+
|
|
636
|
+
* `encoding` **BufferEncoding** 
|
|
637
|
+
|
|
638
|
+
## decodePassword
|
|
639
|
+
|
|
640
|
+
Decode a password
|
|
596
641
|
|
|
597
642
|
### Parameters
|
|
598
643
|
|
|
599
|
-
* `
|
|
644
|
+
* `password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
600
645
|
|
|
601
|
-
|
|
646
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** plaintext password
|
|
602
647
|
|
|
603
|
-
|
|
648
|
+
## FunctionDecl
|
|
604
649
|
|
|
605
|
-
|
|
650
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
606
651
|
|
|
607
|
-
###
|
|
652
|
+
### Properties
|
|
608
653
|
|
|
609
|
-
|
|
654
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
655
|
+
* `body` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
610
656
|
|
|
611
|
-
|
|
657
|
+
## extractFunctions
|
|
612
658
|
|
|
613
|
-
|
|
614
|
-
* `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
659
|
+
Extract shell functions from a given text.
|
|
615
660
|
|
|
616
|
-
|
|
661
|
+
### Parameters
|
|
617
662
|
|
|
618
|
-
|
|
663
|
+
* `source` **AsyncIterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
664
|
+
|
|
665
|
+
Returns **AsyncIterable<[FunctionDecl](#functiondecl)>** 
|
|
666
|
+
|
|
667
|
+
## fieldProvider
|
|
668
|
+
|
|
669
|
+
### Parameters
|
|
670
|
+
|
|
671
|
+
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
672
|
+
* `fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
673
|
+
|
|
674
|
+
Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** 
|
|
675
|
+
|
|
676
|
+
## Expander
|
|
677
|
+
|
|
678
|
+
Type: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)
|
|
679
|
+
|
|
680
|
+
### Parameters
|
|
681
|
+
|
|
682
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
683
|
+
|
|
684
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
685
|
+
|
|
686
|
+
## copyEntries
|
|
687
|
+
|
|
688
|
+
Copy content from source into destinationDirectory.
|
|
689
|
+
Destination paths a generated without leading '/' (as for entry names too).
|
|
690
|
+
|
|
691
|
+
### Parameters
|
|
692
|
+
|
|
693
|
+
* `source` **AsyncIterable\<ContentEntry>** 
|
|
694
|
+
* `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
695
|
+
* `expander` **[Expander](#expander)** (optional, default `v=>v`)
|
|
619
696
|
|
|
620
697
|
# install
|
|
621
698
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
|
-
"provenance":
|
|
6
|
+
"provenance": false
|
|
7
7
|
},
|
|
8
8
|
"types": "./types/module.d.mts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"types": "./types/module.d.mts",
|
|
12
|
+
"default": "./src/module.mjs"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"description": "create ArchLinux, RPM and Debian packages from npm packages",
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
"email": "markus.felten@gmx.de"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"license": "
|
|
37
|
+
"license": "0BSD",
|
|
38
38
|
"bin": {
|
|
39
39
|
"npm-pkgbuild": "src/npm-pkgbuild-cli.mjs"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"prepare": "node --run prepare:typescript",
|
|
43
|
-
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib
|
|
43
|
+
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
|
|
44
44
|
"test": "node --run test:ava",
|
|
45
45
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
46
46
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
47
|
-
"docs": "documentation readme --section=API ./src
|
|
47
|
+
"docs": "documentation readme --section=API ./src**/*.mjs",
|
|
48
48
|
"lint": "node --run lint:docs && node --run lint:typescript",
|
|
49
|
-
"lint:docs": "documentation lint ./src
|
|
50
|
-
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib
|
|
49
|
+
"lint:docs": "documentation lint ./src**/*.mjs",
|
|
50
|
+
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
|
|
51
51
|
"tsc:types": "tsc -d --allowJs --declarationDir dist --emitDeclarationOnly ./src/extract-from-package.mjs"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@npmcli/arborist": "^
|
|
55
|
-
"@vercel/nft": "^0.
|
|
54
|
+
"@npmcli/arborist": "^9.0.0",
|
|
55
|
+
"@vercel/nft": "^0.29.1",
|
|
56
56
|
"aggregate-async-iterator": "^1.2.1",
|
|
57
|
-
"commander": "^
|
|
57
|
+
"commander": "^13.1.0",
|
|
58
58
|
"compare-versions": "^6.1.1",
|
|
59
59
|
"content-entry": "^11.1.3",
|
|
60
60
|
"content-entry-filesystem": "^6.0.0",
|
|
61
61
|
"content-entry-transform": "^1.4.29",
|
|
62
62
|
"execa": "^9.5.2",
|
|
63
63
|
"expression-expander": "^7.2.5",
|
|
64
|
-
"globby": "^14.0
|
|
64
|
+
"globby": "^14.1.0",
|
|
65
65
|
"ini": "^5.0.0",
|
|
66
66
|
"iterable-string-interceptor": "^3.0.0",
|
|
67
67
|
"key-value-transformer": "^3.2.3",
|
|
@@ -70,20 +70,20 @@
|
|
|
70
70
|
"pacote": "^21.0.0",
|
|
71
71
|
"pkg-dir": "^8.0.0",
|
|
72
72
|
"tar-stream": "^3.1.7",
|
|
73
|
-
"uti": "^8.7.
|
|
73
|
+
"uti": "^8.7.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@types/node": "^22.
|
|
76
|
+
"@types/node": "^22.13.4",
|
|
77
77
|
"ava": "^6.2.0",
|
|
78
78
|
"c8": "^10.1.3",
|
|
79
79
|
"documentation": "^14.0.3",
|
|
80
|
-
"semantic-release": "^24.2.
|
|
80
|
+
"semantic-release": "^24.2.3",
|
|
81
81
|
"stream-buffers": "^3.0.3",
|
|
82
|
-
"typescript": "^5.7.
|
|
82
|
+
"typescript": "^5.7.3"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
|
-
"node": ">=
|
|
86
|
-
"bun": ">=1.1"
|
|
85
|
+
"node": ">=22.13.0",
|
|
86
|
+
"bun": ">=1.1.43"
|
|
87
87
|
},
|
|
88
88
|
"repository": {
|
|
89
89
|
"type": "git",
|
|
@@ -3,14 +3,13 @@ import { ContentEntry } from "content-entry";
|
|
|
3
3
|
/**
|
|
4
4
|
* Source of package content.
|
|
5
5
|
* @property {string} dir
|
|
6
|
-
* @property {Transformer[]} transformer
|
|
6
|
+
* @property {Transformer[]} transformer
|
|
7
7
|
*/
|
|
8
8
|
export class ContentProvider {
|
|
9
|
-
|
|
10
9
|
transformers = [];
|
|
11
10
|
entryProperties;
|
|
12
11
|
dir;
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
constructor(definitions, entryProperties) {
|
|
15
14
|
if (entryProperties) {
|
|
16
15
|
this.entryProperties = entryProperties;
|
|
@@ -27,18 +26,9 @@ export class ContentProvider {
|
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
/**
|
|
31
|
-
* @return {string|undefined}
|
|
32
|
-
*/
|
|
33
|
-
get destinationPrefix()
|
|
34
|
-
{
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
29
|
/**
|
|
39
30
|
* List all entries.
|
|
40
31
|
* @return {AsyncIterable<ContentEntry>} all entries
|
|
41
32
|
*/
|
|
42
|
-
async *[Symbol.asyncIterator]() {
|
|
43
|
-
}
|
|
33
|
+
async *[Symbol.asyncIterator]() {}
|
|
44
34
|
}
|
|
@@ -4,7 +4,7 @@ import { FileSystemEntry } from "content-entry-filesystem";
|
|
|
4
4
|
import { asArray } from "../util.mjs";
|
|
5
5
|
import { ContentProvider } from "./content-provider.mjs";
|
|
6
6
|
|
|
7
|
-
const DEFAULT_PATTERN = ["**/*"];
|
|
7
|
+
const DEFAULT_PATTERN = ["**/*", "!.*"];
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Content provided form the file system.
|
|
@@ -14,7 +14,6 @@ import { shrinkNPM } from "../npm-shrink.mjs";
|
|
|
14
14
|
* Content from node_modules.
|
|
15
15
|
* Requires .npmrc or NPM_TOKEN environment
|
|
16
16
|
* @property {boolean} withoutDevelpmentDependencies
|
|
17
|
-
* @property {string} destinationPrefix base name out output
|
|
18
17
|
*/
|
|
19
18
|
export class NodeModulesContentProvider extends ContentProvider {
|
|
20
19
|
/**
|
|
@@ -29,9 +28,11 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
withoutDevelpmentDependencies = true;
|
|
32
|
-
destinationPrefix = "node_modules";
|
|
33
31
|
|
|
34
32
|
constructor(definitions, entryProperties) {
|
|
33
|
+
if (entryProperties?.destination && !entryProperties.destination.endsWith("/")) {
|
|
34
|
+
entryProperties.destination += "/";
|
|
35
|
+
}
|
|
35
36
|
super(definitions, entryProperties);
|
|
36
37
|
Object.assign(this, definitions);
|
|
37
38
|
}
|
|
@@ -26,6 +26,9 @@ export class NPMPackContentProvider extends ContentProvider {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
constructor(definitions, entryProperties) {
|
|
29
|
+
if (entryProperties?.destination && !entryProperties.destination.endsWith("/")) {
|
|
30
|
+
entryProperties.destination += "/";
|
|
31
|
+
}
|
|
29
32
|
super(definitions, entryProperties);
|
|
30
33
|
Object.assign(this, definitions);
|
|
31
34
|
}
|
package/src/output/arch.mjs
CHANGED
|
@@ -146,7 +146,8 @@ export class ARCH extends Packager {
|
|
|
146
146
|
async function* trailingLines() {
|
|
147
147
|
yield `
|
|
148
148
|
package() {
|
|
149
|
-
depends=(${self
|
|
149
|
+
depends=(${self
|
|
150
|
+
.makeDepends(dependencies)
|
|
150
151
|
.map(v => quote(v))
|
|
151
152
|
.join(" ")})
|
|
152
153
|
|
|
@@ -200,6 +201,10 @@ package() {
|
|
|
200
201
|
|
|
201
202
|
if (options.verbose) {
|
|
202
203
|
console.log(await readFile(join(staging, PKGBUILD), utf8StreamOptions));
|
|
204
|
+
console.log("***", staging, "***");
|
|
205
|
+
const ls = await execa("ls", ["-lR"], { cwd: staging });
|
|
206
|
+
console.log(ls.stdout);
|
|
207
|
+
console.log("*** end ***");
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
if (!options.dry) {
|
|
@@ -238,7 +243,12 @@ const fields = {
|
|
|
238
243
|
Maintainer: { alias: "maintainer", type: "string[]", prefix: "# " },
|
|
239
244
|
packager: { alias: "maintainer", type: "string[]" },
|
|
240
245
|
pkgname: { alias: "name", type: "string[]", mandatory: true },
|
|
241
|
-
pkgver: {
|
|
246
|
+
pkgver: {
|
|
247
|
+
alias: "version",
|
|
248
|
+
type: "string",
|
|
249
|
+
mandatory: true,
|
|
250
|
+
set: v => v.replace("-semantic-release", "")
|
|
251
|
+
},
|
|
242
252
|
pkgrel: { alias: "release", type: "integer", default: 1, mandatory: true },
|
|
243
253
|
epoch: { type: "integer", default: 0 },
|
|
244
254
|
pkgdesc: { alias: "description", type: "string", mandatory: true },
|
package/src/util.mjs
CHANGED
|
@@ -200,9 +200,7 @@ export async function* copyEntries(
|
|
|
200
200
|
|
|
201
201
|
// @ts-ignore
|
|
202
202
|
entry.destination = name;
|
|
203
|
-
const destination =
|
|
204
|
-
? join(destinationDirectory, entry.destinationPrefix, name)
|
|
205
|
-
: join(destinationDirectory, name);
|
|
203
|
+
const destination = join(destinationDirectory, name);
|
|
206
204
|
await mkdir(dirname(destination), { recursive: true });
|
|
207
205
|
|
|
208
206
|
const options = { mode: entry.mode };
|
|
@@ -9,10 +9,6 @@ export class ContentProvider {
|
|
|
9
9
|
entryProperties: any;
|
|
10
10
|
dir: any;
|
|
11
11
|
baseProperties: {};
|
|
12
|
-
/**
|
|
13
|
-
* @return {string|undefined}
|
|
14
|
-
*/
|
|
15
|
-
get destinationPrefix(): string | undefined;
|
|
16
12
|
/**
|
|
17
13
|
* List all entries.
|
|
18
14
|
* @return {AsyncIterable<ContentEntry>} all entries
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
* Content from node_modules.
|
|
3
3
|
* Requires .npmrc or NPM_TOKEN environment
|
|
4
4
|
* @property {boolean} withoutDevelpmentDependencies
|
|
5
|
-
* @property {string} destinationPrefix base name out output
|
|
6
5
|
*/
|
|
7
6
|
export class NodeModulesContentProvider extends ContentProvider {
|
|
8
7
|
static get description(): string;
|
|
9
8
|
withoutDevelpmentDependencies: boolean;
|
|
10
|
-
destinationPrefix: string;
|
|
11
9
|
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
12
10
|
}
|
|
13
11
|
import { ContentProvider } from "./content-provider.mjs";
|