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 CHANGED
@@ -1,23 +1,12 @@
1
- Copyright (c) 2018-2024 by arlac77
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
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
  [![npm](https://img.shields.io/npm/v/npm-pkgbuild.svg)](https://www.npmjs.com/package/npm-pkgbuild)
2
- [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
2
+ [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
3
3
  [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
4
4
  [![bundlejs](https://deno.bundlejs.com/?q=npm-pkgbuild\&badge=detailed)](https://bundlejs.com/?q=npm-pkgbuild)
5
5
  [![downloads](http://img.shields.io/npm/dm/npm-pkgbuild.svg?style=flat-square)](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
- * [ContentProvider](#contentprovider)
93
+ * [allInputs](#allinputs)
94
+ * [allOutputs](#alloutputs)
95
+ * [npmArchMapping](#npmarchmapping)
96
+ * [content2Sources](#content2sources)
94
97
  * [Parameters](#parameters)
98
+ * [PackageDefinition](#packagedefinition)
95
99
  * [Properties](#properties)
96
- * [destinationPrefix](#destinationprefix)
97
- * [asyncIterator](#asynciterator)
98
- * [FileContentProvider](#filecontentprovider)
100
+ * [extractFromPackage](#extractfrompackage)
99
101
  * [Parameters](#parameters-1)
100
- * [name](#name)
101
- * [utf8StreamOptions](#utf8streamoptions)
102
- * [Properties](#properties-1)
103
- * [decodePassword](#decodepassword)
102
+ * [NPMPackContentProvider](#npmpackcontentprovider)
104
103
  * [Parameters](#parameters-2)
105
- * [FunctionDecl](#functiondecl)
106
- * [Properties](#properties-2)
107
- * [extractFunctions](#extractfunctions)
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
- * [NodeModulesContentProvider](#nodemodulescontentprovider)
119
- * [Parameters](#parameters-8)
120
- * [Properties](#properties-3)
109
+ * [NFTContentProvider](#nftcontentprovider)
110
+ * [Parameters](#parameters-4)
121
111
  * [name](#name-2)
122
- * [NPMPackContentProvider](#npmpackcontentprovider)
123
- * [Parameters](#parameters-9)
124
- * [Properties](#properties-4)
125
- * [name](#name-3)
126
- * [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
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-10)
137
- * [DOCKER](#docker)
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-11)
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-12)
142
+ * [Parameters](#parameters-11)
143
143
  * [packageName](#packagename)
144
- * [Parameters](#parameters-13)
144
+ * [Parameters](#parameters-12)
145
145
  * [tmpdir](#tmpdir)
146
- * [prepare](#prepare-2)
147
- * [Parameters](#parameters-14)
146
+ * [prepare](#prepare-3)
147
+ * [Parameters](#parameters-13)
148
148
  * [create](#create)
149
- * [Parameters](#parameters-15)
149
+ * [Parameters](#parameters-14)
150
150
  * [workspaceLayout](#workspacelayout)
151
- * [prepare](#prepare-3)
152
- * [Parameters](#parameters-16)
151
+ * [prepare](#prepare-4)
152
+ * [Parameters](#parameters-15)
153
153
  * [Packager](#packager-1)
154
- * [Parameters](#parameters-17)
154
+ * [Parameters](#parameters-16)
155
155
  * [packageName](#packagename-1)
156
- * [Parameters](#parameters-18)
156
+ * [Parameters](#parameters-17)
157
157
  * [tmpdir](#tmpdir-1)
158
- * [prepare](#prepare-4)
159
- * [Parameters](#parameters-19)
158
+ * [prepare](#prepare-5)
159
+ * [Parameters](#parameters-18)
160
160
  * [create](#create-1)
161
- * [Parameters](#parameters-20)
161
+ * [Parameters](#parameters-19)
162
162
  * [workspaceLayout](#workspacelayout-1)
163
- * [prepare](#prepare-5)
164
- * [Parameters](#parameters-21)
163
+ * [prepare](#prepare-6)
164
+ * [Parameters](#parameters-20)
165
165
  * [Field](#field)
166
- * [Properties](#properties-5)
166
+ * [Properties](#properties-4)
167
+ * [copyNodeModules](#copynodemodules)
168
+ * [Parameters](#parameters-21)
167
169
  * [PublishingDetail](#publishingdetail)
168
- * [Properties](#properties-6)
170
+ * [Properties](#properties-5)
169
171
  * [createPublishingDetails](#createpublishingdetails)
170
172
  * [Parameters](#parameters-22)
171
173
  * [publish](#publish)
172
174
  * [Parameters](#parameters-23)
173
- * [quoteFile](#quotefile)
175
+ * [utf8StreamOptions](#utf8streamoptions)
176
+ * [Properties](#properties-6)
177
+ * [decodePassword](#decodepassword)
174
178
  * [Parameters](#parameters-24)
175
- * [RPM](#rpm)
176
- * [prepare](#prepare-6)
177
- * [Parameters](#parameters-25)
178
-
179
- ## ContentProvider
180
-
181
- Source of package content.
182
-
183
- ### Parameters
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>**&#x20;
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
- ### destinationPrefix
190
+ ## allInputs
194
191
 
195
- 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))**&#x20;
192
+ All content providers (input)
196
193
 
197
- ### asyncIterator
194
+ ## allOutputs
198
195
 
199
- List all entries.
196
+ All output formats
200
197
 
201
- Returns **AsyncIterable\<ContentEntry>** all entries
198
+ ## npmArchMapping
202
199
 
203
- ## FileContentProvider
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
- **Extends ContentProvider**
203
+ ## content2Sources
206
204
 
207
- Content provided form the file system.
205
+ Delivers ContentProviders from pkgbuild.content definition.
208
206
 
209
207
  ### Parameters
210
208
 
211
- * `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))**&#x20;
209
+ * `content` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** from pkgbuild.content
210
+ * `dir` &#x20;
212
211
 
213
- * `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)>)**&#x20;
214
- * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
215
- * `entryProperties` &#x20;
212
+ Returns **Iterable<[ContentProvider](#contentprovider)>**&#x20;
216
213
 
217
- ### name
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
- * `encoding` **BufferEncoding**&#x20;
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)**&#x20;
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
- ## decodePassword
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
- Decode a password
229
+ ## extractFromPackage
232
230
 
233
- ### Parameters
231
+ Extract package definition from package.json.
234
232
 
235
- * `password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** plaintext password
238
+ ### Parameters
238
239
 
239
- ## FunctionDecl
240
+ * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
240
241
 
241
- Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
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
- ### Properties
246
+ Returns **AsyncIterable<[PackageDefinition](#packagedefinition)>**&#x20;
244
247
 
245
- * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
246
- * `body` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
248
+ ## NPMPackContentProvider
247
249
 
248
- ## extractFunctions
250
+ **Extends ContentProvider**
249
251
 
250
- Extract shell functions from a given text.
252
+ Content from npm pack.
251
253
 
252
254
  ### Parameters
253
255
 
254
- * `source` **AsyncIterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
256
+ * `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
257
+ * `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
255
258
 
256
- Returns **AsyncIterable<[FunctionDecl](#functiondecl)>**&#x20;
259
+ ### Properties
257
260
 
258
- ## fieldProvider
261
+ * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
259
262
 
260
- ### Parameters
263
+ ### name
261
264
 
262
- * `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
263
- * `fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
265
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
264
266
 
265
- Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;
267
+ ## FileContentProvider
266
268
 
267
- ## Expander
269
+ **Extends ContentProvider**
268
270
 
269
- Type: [Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)
271
+ Content provided form the file system.
270
272
 
271
273
  ### Parameters
272
274
 
273
- * `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
274
-
275
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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))**&#x20;
278
276
 
279
- Copy content from source into destinationDirectory.
280
- Destination paths a generated without leading '/' (as for entry names too).
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)>)**&#x20;
278
+ * `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
279
+ * `entryProperties` &#x20;
281
280
 
282
- ### Parameters
281
+ ### name
283
282
 
284
- * `source` **AsyncIterable\<ContentEntry>**&#x20;
285
- * `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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
- ## NodeModulesContentProvider
307
-
308
- **Extends ContentProvider**
303
+ ## ContentProvider
309
304
 
310
- Content from node\_modules.
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
- * `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
321
- * `destinationPrefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base name out output
314
+ * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
315
+ * `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<Transformer>**&#x20;
322
316
 
323
- ### name
317
+ ### destinationPrefix
324
318
 
325
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
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))**&#x20;
326
320
 
327
- ## NPMPackContentProvider
321
+ ### asyncIterator
328
322
 
329
- **Extends ContentProvider**
323
+ List all entries.
330
324
 
331
- Content from npm pack.
325
+ Returns **AsyncIterable\<ContentEntry>** all entries
332
326
 
333
- ### Parameters
327
+ ## hookMapping
334
328
 
335
- * `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
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
- ### Properties
331
+ ## hookMapping
339
332
 
340
- * `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
333
+ map install hook named from arch to rpm
341
334
 
342
- ### name
335
+ ## DEBIAN
343
336
 
344
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
337
+ **Extends Packager**
345
338
 
346
- ## pkgKeyValuePairOptions
339
+ Create .deb packages
347
340
 
348
- Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
341
+ ### prepare
349
342
 
350
- ## fields
343
+ #### Parameters
351
344
 
352
- well known package properties
353
- <https://www.archlinux.org/pacman/PKGBUILD.5.html>
345
+ * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
346
+ * `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
347
+
348
+ * `variant.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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)>**&#x20;
354
351
 
355
352
  ## fields
356
353
 
@@ -359,34 +356,37 @@ well known package properties
359
356
 
360
357
  ## fields
361
358
 
362
- * **See**: <https://docs.docker.com/engine/reference/builder/>
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
- ## BUILDAH
366
+ ## fields
369
367
 
370
- **Extends DOCKER**
368
+ * **See**: <https://docs.docker.com/engine/reference/builder/>
371
369
 
372
- Use buildah @see <https://buildah.io>
370
+ ## pkgKeyValuePairOptions
373
371
 
374
- ## hookMapping
372
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
375
373
 
376
- map install hook named from arch to deb
374
+ ## quoteFile
377
375
 
378
- ## hookMapping
376
+ ### Parameters
379
377
 
380
- map install hook named from arch to rpm
378
+ * `name` &#x20;
381
379
 
382
- ## DEBIAN
380
+ ## RPM
383
381
 
384
382
  **Extends Packager**
385
383
 
386
- Create .deb packages
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)**&#x20;
@@ -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)**&#x20;
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)>**&#x20;
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
- ## OCI
424
+ ## BUILDAH
419
425
 
420
- **Extends Packager**
426
+ **Extends DOCKER**
421
427
 
422
- Low level OCI compatible packager
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` &#x20;
440
+ * `entryProperties` &#x20;
441
+
442
+ ### Properties
443
+
444
+ * `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
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**&#x20;
557
584
  * `mandatory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
558
585
 
586
+ ## copyNodeModules
587
+
588
+ ### Parameters
589
+
590
+ * `source` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
591
+ * `dest` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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)?**&#x20;
593
628
  * `logger` **function (any): void** (optional, default `console.log`)
594
629
 
595
- ## quoteFile
630
+ ## utf8StreamOptions
631
+
632
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
633
+
634
+ ### Properties
635
+
636
+ * `encoding` **BufferEncoding**&#x20;
637
+
638
+ ## decodePassword
639
+
640
+ Decode a password
596
641
 
597
642
  ### Parameters
598
643
 
599
- * `name` &#x20;
644
+ * `password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
600
645
 
601
- ## RPM
646
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** plaintext password
602
647
 
603
- **Extends Packager**
648
+ ## FunctionDecl
604
649
 
605
- produce rpm packages
650
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
606
651
 
607
- ### prepare
652
+ ### Properties
608
653
 
609
- Check for rpmbuild presence.
654
+ * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
655
+ * `body` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
610
656
 
611
- #### Parameters
657
+ ## extractFunctions
612
658
 
613
- * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
614
- * `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
659
+ Extract shell functions from a given text.
615
660
 
616
- * `variant.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
661
+ ### Parameters
617
662
 
618
- 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
663
+ * `source` **AsyncIterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
664
+
665
+ Returns **AsyncIterable<[FunctionDecl](#functiondecl)>**&#x20;
666
+
667
+ ## fieldProvider
668
+
669
+ ### Parameters
670
+
671
+ * `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
672
+ * `fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
673
+
674
+ Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;
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)**&#x20;
683
+
684
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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>**&#x20;
694
+ * `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
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": "15.6.11",
3
+ "version": "16.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
- "provenance": true
6
+ "provenance": false
7
7
  },
8
8
  "types": "./types/module.d.mts",
9
9
  "exports": {
10
10
  ".": {
11
- "default": "./src/module.mjs",
12
- "types": "./types/module.d.mts"
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": "BSD-2-Clause",
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 es2024 -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
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/**/*.mjs",
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/**/*.mjs",
50
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
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": "^8.0.0",
55
- "@vercel/nft": "^0.27.9",
54
+ "@npmcli/arborist": "^9.0.0",
55
+ "@vercel/nft": "^0.29.1",
56
56
  "aggregate-async-iterator": "^1.2.1",
57
- "commander": "^12.1.0",
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.2",
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.0"
73
+ "uti": "^8.7.1"
74
74
  },
75
75
  "devDependencies": {
76
- "@types/node": "^22.10.2",
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.0",
80
+ "semantic-release": "^24.2.3",
81
81
  "stream-buffers": "^3.0.3",
82
- "typescript": "^5.7.2"
82
+ "typescript": "^5.7.3"
83
83
  },
84
84
  "engines": {
85
- "node": ">=20.18.0",
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
  }
@@ -146,7 +146,8 @@ export class ARCH extends Packager {
146
146
  async function* trailingLines() {
147
147
  yield `
148
148
  package() {
149
- depends=(${self.makeDepends(dependencies)
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: { alias: "version", type: "string", mandatory: true },
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 = entry.destinationPrefix
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";
@@ -25,6 +25,7 @@ export class ARCH extends Packager {
25
25
  alias: string;
26
26
  type: string;
27
27
  mandatory: boolean;
28
+ set: (v: any) => any;
28
29
  };
29
30
  pkgrel: {
30
31
  alias: string;