npm-pkgbuild 14.0.3 → 14.1.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 +195 -83
- package/package.json +4 -4
- package/src/content/node-modules-content-provider.mjs +6 -3
- package/src/extract-from-package.mjs +1 -0
- package/src/module.mjs +18 -14
- package/src/npm-pkgbuild-cli.mjs +5 -4
- package/src/output/arch.mjs +2 -2
- package/src/output/debian.mjs +12 -5
- package/src/output/docker.mjs +20 -11
- package/src/output/oci.mjs +3 -2
- package/src/output/packager.mjs +46 -24
- package/src/output/rpm.mjs +7 -3
- package/src/package.mjs +10 -7
- package/src/publish.mjs +80 -73
- package/types/content/node-modules-content-provider.d.mts +1 -0
- package/types/extract-from-package.d.mts +4 -1
- package/types/module.d.mts +13 -13
- package/types/output/arch.d.mts +1 -0
- package/types/output/debian.d.mts +1 -0
- package/types/output/docker.d.mts +2 -2
- package/types/output/oci.d.mts +1 -1
- package/types/output/packager.d.mts +34 -10
- package/types/output/rpm.d.mts +2 -0
- package/types/publish.d.mts +27 -19
package/README.md
CHANGED
|
@@ -97,28 +97,28 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
97
97
|
* [FileContentProvider](#filecontentprovider)
|
|
98
98
|
* [Parameters](#parameters-1)
|
|
99
99
|
* [name](#name)
|
|
100
|
-
* [NFTContentProvider](#nftcontentprovider)
|
|
101
|
-
* [Parameters](#parameters-2)
|
|
102
|
-
* [name](#name-1)
|
|
103
|
-
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
104
|
-
* [Parameters](#parameters-3)
|
|
105
|
-
* [Properties](#properties-1)
|
|
106
|
-
* [name](#name-2)
|
|
107
100
|
* [utf8StreamOptions](#utf8streamoptions)
|
|
108
|
-
* [Properties](#properties-
|
|
101
|
+
* [Properties](#properties-1)
|
|
109
102
|
* [packageNameMapping](#packagenamemapping)
|
|
110
103
|
* [decodePassword](#decodepassword)
|
|
111
|
-
* [Parameters](#parameters-
|
|
104
|
+
* [Parameters](#parameters-2)
|
|
112
105
|
* [FunctionDecl](#functiondecl)
|
|
113
|
-
* [Properties](#properties-
|
|
106
|
+
* [Properties](#properties-2)
|
|
114
107
|
* [extractFunctions](#extractfunctions)
|
|
115
|
-
* [Parameters](#parameters-
|
|
108
|
+
* [Parameters](#parameters-3)
|
|
116
109
|
* [fieldProvider](#fieldprovider)
|
|
117
|
-
* [Parameters](#parameters-
|
|
110
|
+
* [Parameters](#parameters-4)
|
|
118
111
|
* [Expander](#expander)
|
|
119
|
-
* [Parameters](#parameters-
|
|
112
|
+
* [Parameters](#parameters-5)
|
|
120
113
|
* [copyEntries](#copyentries)
|
|
114
|
+
* [Parameters](#parameters-6)
|
|
115
|
+
* [NFTContentProvider](#nftcontentprovider)
|
|
116
|
+
* [Parameters](#parameters-7)
|
|
117
|
+
* [name](#name-1)
|
|
118
|
+
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
121
119
|
* [Parameters](#parameters-8)
|
|
120
|
+
* [Properties](#properties-3)
|
|
121
|
+
* [name](#name-2)
|
|
122
122
|
* [NPMPackContentProvider](#npmpackcontentprovider)
|
|
123
123
|
* [Parameters](#parameters-9)
|
|
124
124
|
* [Properties](#properties-4)
|
|
@@ -137,22 +137,40 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
137
137
|
* [DOCKER](#docker)
|
|
138
138
|
* [prepare](#prepare-1)
|
|
139
139
|
* [Parameters](#parameters-11)
|
|
140
|
-
* [publish](#publish)
|
|
141
|
-
* [Parameters](#parameters-12)
|
|
142
140
|
* [OCI](#oci)
|
|
143
|
-
* [Field](#field)
|
|
144
|
-
* [Properties](#properties-5)
|
|
145
141
|
* [Packager](#packager)
|
|
146
|
-
* [Parameters](#parameters-
|
|
142
|
+
* [Parameters](#parameters-12)
|
|
147
143
|
* [tmpdir](#tmpdir)
|
|
148
|
-
* [
|
|
144
|
+
* [prepare](#prepare-2)
|
|
145
|
+
* [Parameters](#parameters-13)
|
|
146
|
+
* [create](#create)
|
|
149
147
|
* [Parameters](#parameters-14)
|
|
150
148
|
* [workspaceLayout](#workspacelayout)
|
|
151
|
-
* [prepare](#prepare-
|
|
149
|
+
* [prepare](#prepare-3)
|
|
152
150
|
* [Parameters](#parameters-15)
|
|
151
|
+
* [Packager](#packager-1)
|
|
152
|
+
* [Parameters](#parameters-16)
|
|
153
|
+
* [tmpdir](#tmpdir-1)
|
|
154
|
+
* [prepare](#prepare-4)
|
|
155
|
+
* [Parameters](#parameters-17)
|
|
156
|
+
* [create](#create-1)
|
|
157
|
+
* [Parameters](#parameters-18)
|
|
158
|
+
* [workspaceLayout](#workspacelayout-1)
|
|
159
|
+
* [prepare](#prepare-5)
|
|
160
|
+
* [Parameters](#parameters-19)
|
|
161
|
+
* [Field](#field)
|
|
162
|
+
* [Properties](#properties-5)
|
|
163
|
+
* [PublishingDetail](#publishingdetail)
|
|
164
|
+
* [Properties](#properties-6)
|
|
165
|
+
* [createPublishingDetails](#createpublishingdetails)
|
|
166
|
+
* [Parameters](#parameters-20)
|
|
167
|
+
* [publish](#publish)
|
|
168
|
+
* [Parameters](#parameters-21)
|
|
169
|
+
* [quoteFile](#quotefile)
|
|
170
|
+
* [Parameters](#parameters-22)
|
|
153
171
|
* [RPM](#rpm)
|
|
154
|
-
* [prepare](#prepare-
|
|
155
|
-
* [Parameters](#parameters-
|
|
172
|
+
* [prepare](#prepare-6)
|
|
173
|
+
* [Parameters](#parameters-23)
|
|
156
174
|
|
|
157
175
|
## ContentProvider
|
|
158
176
|
|
|
@@ -192,44 +210,6 @@ Content provided form the file system.
|
|
|
192
210
|
|
|
193
211
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
194
212
|
|
|
195
|
-
## NFTContentProvider
|
|
196
|
-
|
|
197
|
-
**Extends ContentProvider**
|
|
198
|
-
|
|
199
|
-
Content provided form the file system.
|
|
200
|
-
|
|
201
|
-
### Parameters
|
|
202
|
-
|
|
203
|
-
* `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))** 
|
|
204
|
-
|
|
205
|
-
* `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)>)** 
|
|
206
|
-
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
207
|
-
* `entryProperties`  
|
|
208
|
-
|
|
209
|
-
### name
|
|
210
|
-
|
|
211
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
212
|
-
|
|
213
|
-
## NodeModulesContentProvider
|
|
214
|
-
|
|
215
|
-
**Extends ContentProvider**
|
|
216
|
-
|
|
217
|
-
Content from node\_modules.
|
|
218
|
-
Requires .npmrc or NPM\_TOKEN environment
|
|
219
|
-
|
|
220
|
-
### Parameters
|
|
221
|
-
|
|
222
|
-
* `definitions`  
|
|
223
|
-
* `entryProperties`  
|
|
224
|
-
|
|
225
|
-
### Properties
|
|
226
|
-
|
|
227
|
-
* `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
228
|
-
|
|
229
|
-
### name
|
|
230
|
-
|
|
231
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
232
|
-
|
|
233
213
|
## utf8StreamOptions
|
|
234
214
|
|
|
235
215
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
@@ -301,6 +281,44 @@ Destination paths a generated without leading '/' (as for entry names too).
|
|
|
301
281
|
* `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
302
282
|
* `expander` **[Expander](#expander)** (optional, default `v=>v`)
|
|
303
283
|
|
|
284
|
+
## NFTContentProvider
|
|
285
|
+
|
|
286
|
+
**Extends ContentProvider**
|
|
287
|
+
|
|
288
|
+
Content provided form the file system.
|
|
289
|
+
|
|
290
|
+
### Parameters
|
|
291
|
+
|
|
292
|
+
* `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))** 
|
|
293
|
+
|
|
294
|
+
* `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)>)** 
|
|
295
|
+
* `definitions.base` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** base directory where to find the files
|
|
296
|
+
* `entryProperties`  
|
|
297
|
+
|
|
298
|
+
### name
|
|
299
|
+
|
|
300
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
301
|
+
|
|
302
|
+
## NodeModulesContentProvider
|
|
303
|
+
|
|
304
|
+
**Extends ContentProvider**
|
|
305
|
+
|
|
306
|
+
Content from node\_modules.
|
|
307
|
+
Requires .npmrc or NPM\_TOKEN environment
|
|
308
|
+
|
|
309
|
+
### Parameters
|
|
310
|
+
|
|
311
|
+
* `definitions`  
|
|
312
|
+
* `entryProperties`  
|
|
313
|
+
|
|
314
|
+
### Properties
|
|
315
|
+
|
|
316
|
+
* `withoutDevelpmentDependencies` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
317
|
+
|
|
318
|
+
### name
|
|
319
|
+
|
|
320
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
321
|
+
|
|
304
322
|
## NPMPackContentProvider
|
|
305
323
|
|
|
306
324
|
**Extends ContentProvider**
|
|
@@ -392,31 +410,62 @@ Check for docker presence.
|
|
|
392
410
|
|
|
393
411
|
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
|
|
394
412
|
|
|
395
|
-
##
|
|
413
|
+
## OCI
|
|
414
|
+
|
|
415
|
+
**Extends Packager**
|
|
416
|
+
|
|
417
|
+
Low level OCI compatible packager
|
|
418
|
+
|
|
419
|
+
## Packager
|
|
396
420
|
|
|
397
421
|
### Parameters
|
|
398
422
|
|
|
399
|
-
* `
|
|
400
|
-
* `destination` **any** 
|
|
401
|
-
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
402
|
-
* `logger` **function (any): void** (optional, default `console.log`)
|
|
423
|
+
* `properties`  
|
|
403
424
|
|
|
404
|
-
|
|
425
|
+
### tmpdir
|
|
405
426
|
|
|
406
|
-
|
|
427
|
+
Create tmp directory.
|
|
407
428
|
|
|
408
|
-
|
|
429
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** directory path
|
|
409
430
|
|
|
410
|
-
|
|
431
|
+
### prepare
|
|
411
432
|
|
|
412
|
-
|
|
433
|
+
Prepares artifact generation
|
|
413
434
|
|
|
414
|
-
|
|
435
|
+
#### Parameters
|
|
415
436
|
|
|
416
|
-
* `
|
|
417
|
-
* `
|
|
418
|
-
|
|
419
|
-
|
|
437
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
438
|
+
* `publishingDetail` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
439
|
+
|
|
440
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{properties: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), destination: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), tmpdir: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), staging: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
441
|
+
|
|
442
|
+
### create
|
|
443
|
+
|
|
444
|
+
Execute package generation.
|
|
445
|
+
|
|
446
|
+
#### Parameters
|
|
447
|
+
|
|
448
|
+
* `sources` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
449
|
+
* `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** 
|
|
450
|
+
* `dependencies` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
451
|
+
* `publishingDetails` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[PublishingDetail](#publishingdetail)>** 
|
|
452
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
453
|
+
* `expander` **function ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)): [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
454
|
+
|
|
455
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** identifier of the resulting package
|
|
456
|
+
|
|
457
|
+
### workspaceLayout
|
|
458
|
+
|
|
459
|
+
Returns **{named: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), others: \[]}** 
|
|
460
|
+
|
|
461
|
+
### prepare
|
|
462
|
+
|
|
463
|
+
#### Parameters
|
|
464
|
+
|
|
465
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
466
|
+
* `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
467
|
+
|
|
468
|
+
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)>** 
|
|
420
469
|
|
|
421
470
|
## Packager
|
|
422
471
|
|
|
@@ -432,23 +481,35 @@ Create tmp directory.
|
|
|
432
481
|
|
|
433
482
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** directory path
|
|
434
483
|
|
|
435
|
-
###
|
|
484
|
+
### prepare
|
|
485
|
+
|
|
486
|
+
Prepares artifact generation
|
|
487
|
+
|
|
488
|
+
#### Parameters
|
|
489
|
+
|
|
490
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
491
|
+
* `publishingDetail` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
492
|
+
|
|
493
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{properties: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), destination: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), tmpdir: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), staging: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
494
|
+
|
|
495
|
+
### create
|
|
436
496
|
|
|
437
497
|
Execute package generation.
|
|
438
498
|
|
|
439
499
|
#### Parameters
|
|
440
500
|
|
|
441
|
-
* `sources`
|
|
442
|
-
* `transformer`
|
|
443
|
-
* `dependencies`
|
|
444
|
-
* `
|
|
445
|
-
* `
|
|
501
|
+
* `sources` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
502
|
+
* `transformer` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** 
|
|
503
|
+
* `dependencies` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
504
|
+
* `publishingDetails` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[PublishingDetail](#publishingdetail)>** 
|
|
505
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
506
|
+
* `expander` **function ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)): [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
446
507
|
|
|
447
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
|
|
508
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** identifier of the resulting package
|
|
448
509
|
|
|
449
510
|
### workspaceLayout
|
|
450
511
|
|
|
451
|
-
Returns **[
|
|
512
|
+
Returns **{named: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), others: \[]}** 
|
|
452
513
|
|
|
453
514
|
### prepare
|
|
454
515
|
|
|
@@ -459,6 +520,57 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
459
520
|
|
|
460
521
|
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)>** 
|
|
461
522
|
|
|
523
|
+
## Field
|
|
524
|
+
|
|
525
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
526
|
+
|
|
527
|
+
### Properties
|
|
528
|
+
|
|
529
|
+
* `alias` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** interchangeable field name
|
|
530
|
+
* `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
531
|
+
* `default` **any** 
|
|
532
|
+
* `mandatory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
533
|
+
|
|
534
|
+
## PublishingDetail
|
|
535
|
+
|
|
536
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
537
|
+
|
|
538
|
+
### Properties
|
|
539
|
+
|
|
540
|
+
* `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
541
|
+
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
542
|
+
* `scheme` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
543
|
+
* `username` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
544
|
+
* `password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
545
|
+
|
|
546
|
+
## createPublishingDetails
|
|
547
|
+
|
|
548
|
+
### Parameters
|
|
549
|
+
|
|
550
|
+
* `locations` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
551
|
+
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
552
|
+
|
|
553
|
+
* `properties.PKGBUILD_PUBLISH` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
554
|
+
* `properties.arch` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
555
|
+
* `properties.access` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
556
|
+
|
|
557
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[PublishingDetail](#publishingdetail)>** 
|
|
558
|
+
|
|
559
|
+
## publish
|
|
560
|
+
|
|
561
|
+
### Parameters
|
|
562
|
+
|
|
563
|
+
* `artifactIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
564
|
+
* `publishingDetail` **[PublishingDetail](#publishingdetail)** 
|
|
565
|
+
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
566
|
+
* `logger` **function (any): void** (optional, default `console.log`)
|
|
567
|
+
|
|
568
|
+
## quoteFile
|
|
569
|
+
|
|
570
|
+
### Parameters
|
|
571
|
+
|
|
572
|
+
* `name`  
|
|
573
|
+
|
|
462
574
|
## RPM
|
|
463
575
|
|
|
464
576
|
**Extends Packager**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"aggregate-async-iterator": "^1.2.0",
|
|
57
57
|
"commander": "^12.0.0",
|
|
58
58
|
"compare-versions": "^6.1.0",
|
|
59
|
-
"content-entry": "^9.0.
|
|
59
|
+
"content-entry": "^9.0.3",
|
|
60
60
|
"content-entry-filesystem": "^6.0.0",
|
|
61
61
|
"content-entry-transform": "^1.4.29",
|
|
62
62
|
"execa": "^8.0.1",
|
|
63
63
|
"expression-expander": "^7.1.3",
|
|
64
64
|
"globby": "^14.0.1",
|
|
65
65
|
"ini": "^4.1.2",
|
|
66
|
-
"iterable-string-interceptor": "^
|
|
67
|
-
"key-value-transformer": "^3.2.
|
|
66
|
+
"iterable-string-interceptor": "^3.0.0",
|
|
67
|
+
"key-value-transformer": "^3.2.3",
|
|
68
68
|
"npm-package-walker": "^6.2.4",
|
|
69
69
|
"npm-packlist": "^8.0.2",
|
|
70
70
|
"pacote": "^17.0.6",
|
|
@@ -28,9 +28,11 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
28
28
|
return "use node_modules as source";
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
withoutDevelpmentDependencies = true;
|
|
32
|
+
|
|
31
33
|
constructor(definitions, entryProperties) {
|
|
32
34
|
super(definitions, entryProperties);
|
|
33
|
-
Object.assign(this,
|
|
35
|
+
Object.assign(this, definitions);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
toString() {
|
|
@@ -45,6 +47,7 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
45
47
|
pkgSourceDir = await mkdtemp(join(tmpdir(), "node-modules"));
|
|
46
48
|
|
|
47
49
|
const json = JSON.parse(
|
|
50
|
+
//@ts-ignore
|
|
48
51
|
await readFile(join(this.dir, "package.json"), utf8StreamOptions)
|
|
49
52
|
);
|
|
50
53
|
delete json.devDependencies;
|
|
@@ -96,9 +99,9 @@ export class NodeModulesContentProvider extends ContentProvider {
|
|
|
96
99
|
try {
|
|
97
100
|
const json = shrinkNPM(
|
|
98
101
|
JSON.parse(
|
|
102
|
+
//@ts-ignore
|
|
99
103
|
await readFile(join(pkgSourceDir, name), utf8StreamOptions)
|
|
100
|
-
)
|
|
101
|
-
{}
|
|
104
|
+
)
|
|
102
105
|
);
|
|
103
106
|
|
|
104
107
|
if (json) {
|
|
@@ -96,6 +96,7 @@ function* content2Sources(content, dir) {
|
|
|
96
96
|
* @property {Object} output package type
|
|
97
97
|
* @property {Object} variant identifier of the variant
|
|
98
98
|
* @property {string} variant.name name of the variant
|
|
99
|
+
* @property {string} variant.arch name of the architecture
|
|
99
100
|
*/
|
|
100
101
|
|
|
101
102
|
/**
|
package/src/module.mjs
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
2
1
|
export * from "./util.mjs";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
2
|
+
export { createPublishingDetails, publish } from "./publish.mjs";
|
|
3
|
+
export {
|
|
4
|
+
extractFromPackage,
|
|
5
|
+
allInputs,
|
|
6
|
+
allOutputs,
|
|
7
|
+
npmArchMapping
|
|
8
|
+
} from "./extract-from-package.mjs";
|
|
9
|
+
export { ContentProvider } from "./content/content-provider.mjs";
|
|
10
|
+
export { FileContentProvider } from "./content/file-content-provider.mjs";
|
|
11
|
+
export { NodeModulesContentProvider } from "./content/node-modules-content-provider.mjs";
|
|
12
|
+
export { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
|
|
13
|
+
export { NFTContentProvider } from "./content/nft-content-provider.mjs";
|
|
14
|
+
export { DEBIAN } from "./output/debian.mjs";
|
|
15
|
+
export { RPM } from "./output/rpm.mjs";
|
|
16
|
+
export { ARCH } from "./output/arch.mjs";
|
|
17
|
+
export { OCI } from "./output/oci.mjs";
|
|
18
|
+
export { DOCKER } from "./output/docker.mjs";
|
|
19
|
+
export { Packager } from "./output/packager.mjs";
|
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
allInputs,
|
|
10
10
|
allOutputs,
|
|
11
11
|
extractFromPackage,
|
|
12
|
-
|
|
12
|
+
createPublishingDetails
|
|
13
13
|
} from "npm-pkgbuild";
|
|
14
14
|
import pkg from "../package.json" assert { type: "json" };
|
|
15
15
|
|
|
@@ -50,7 +50,7 @@ program
|
|
|
50
50
|
const uc = new UTIController();
|
|
51
51
|
uc.register(additionalUTIs);
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const publishingDetails = createPublishingDetails(options.publish, process.env);
|
|
54
54
|
|
|
55
55
|
for await (const {
|
|
56
56
|
properties,
|
|
@@ -123,16 +123,17 @@ program
|
|
|
123
123
|
console.log(kv(dependencies, " "));
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
const artifact = await o.
|
|
126
|
+
const artifact = await o.create(
|
|
127
127
|
sources.map(c => c[Symbol.asyncIterator]()),
|
|
128
128
|
transformer,
|
|
129
129
|
dependencies,
|
|
130
|
+
publishingDetails,
|
|
130
131
|
options,
|
|
131
132
|
context.expand
|
|
132
133
|
);
|
|
133
134
|
|
|
134
135
|
if (!options.dry) {
|
|
135
|
-
await Promise.all(
|
|
136
|
+
await Promise.all(publishingDetails.map(publishDetail => o.publish(artifact, publishDetail, o.properties)));
|
|
136
137
|
}
|
|
137
138
|
} catch (e) {
|
|
138
139
|
handleError(e, options);
|
package/src/output/arch.mjs
CHANGED
|
@@ -120,8 +120,8 @@ export class ARCH extends Packager {
|
|
|
120
120
|
return `${p.name}-${p.version}-${p.release}-${p.arch}${this.fileNameExtension}`;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
async
|
|
124
|
-
const { properties, staging, destination } = await this.
|
|
123
|
+
async create(sources, transformer, dependencies, publishingDetails, options, expander) {
|
|
124
|
+
const { properties, staging, destination } = await this.prepare(
|
|
125
125
|
options
|
|
126
126
|
);
|
|
127
127
|
|
package/src/output/debian.mjs
CHANGED
|
@@ -62,7 +62,7 @@ export class DEBIAN extends Packager {
|
|
|
62
62
|
await execa("dpkg", ["--version"]);
|
|
63
63
|
if (variant?.arch) {
|
|
64
64
|
const uname = await execa("uname", ["-m"]);
|
|
65
|
-
return uname.stdout.match(variant.arch);
|
|
65
|
+
return uname.stdout.match(variant.arch) ? true : false;
|
|
66
66
|
}
|
|
67
67
|
return true;
|
|
68
68
|
} catch {}
|
|
@@ -72,6 +72,7 @@ export class DEBIAN extends Packager {
|
|
|
72
72
|
|
|
73
73
|
get packageFileName() {
|
|
74
74
|
const p = this.properties;
|
|
75
|
+
// @ts-ignore
|
|
75
76
|
return `${p.name}_${p.version}_${p.arch}${this.constructor.fileNameExtension}`;
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -95,10 +96,15 @@ export class DEBIAN extends Packager {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
async
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
async create(
|
|
100
|
+
sources,
|
|
101
|
+
transformer,
|
|
102
|
+
dependencies,
|
|
103
|
+
publishingDetails,
|
|
104
|
+
options,
|
|
105
|
+
expander
|
|
106
|
+
) {
|
|
107
|
+
const { properties, staging, destination } = await this.prepare(options);
|
|
102
108
|
|
|
103
109
|
transformer.push(
|
|
104
110
|
createPropertiesTransformer(
|
|
@@ -141,6 +147,7 @@ export class DEBIAN extends Packager {
|
|
|
141
147
|
expander
|
|
142
148
|
)) {
|
|
143
149
|
if (options.verbose) {
|
|
150
|
+
// @ts-ignore
|
|
144
151
|
console.log(file.destination, `mode=${file.mode}`);
|
|
145
152
|
}
|
|
146
153
|
}
|
package/src/output/docker.mjs
CHANGED
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
equalSeparatedKeyValuePairOptions
|
|
10
10
|
} from "key-value-transformer";
|
|
11
11
|
import { Packager } from "./packager.mjs";
|
|
12
|
-
import { analysePublish } from "../publish.mjs";
|
|
13
12
|
import {
|
|
14
13
|
fieldProvider,
|
|
15
14
|
copyEntries,
|
|
@@ -67,14 +66,15 @@ export class DOCKER extends Packager {
|
|
|
67
66
|
return false;
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
async
|
|
69
|
+
async create(
|
|
71
70
|
sources,
|
|
72
71
|
transformer,
|
|
73
72
|
dependencies,
|
|
74
73
|
options,
|
|
74
|
+
publishingDetails,
|
|
75
75
|
expander = v => v
|
|
76
76
|
) {
|
|
77
|
-
const { properties, staging } = await this.
|
|
77
|
+
const { properties, staging } = await this.prepare(options, publishingDetails);
|
|
78
78
|
|
|
79
79
|
async function* headLines() {
|
|
80
80
|
let scratch = true;
|
|
@@ -144,6 +144,7 @@ export class DOCKER extends Packager {
|
|
|
144
144
|
const docker = await execa(
|
|
145
145
|
this.constructor.name,
|
|
146
146
|
[
|
|
147
|
+
"buildx",
|
|
147
148
|
"build",
|
|
148
149
|
"--tag",
|
|
149
150
|
tag,
|
|
@@ -169,20 +170,28 @@ export class DOCKER extends Packager {
|
|
|
169
170
|
return image;
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
async publish(artifact,
|
|
173
|
-
const publish = analysePublish(destination, properties);
|
|
174
|
-
|
|
173
|
+
async publish(artifact, publishingDetails, properties, logger = console.log) {
|
|
175
174
|
try {
|
|
176
|
-
const url = new URL(
|
|
177
|
-
const repoLocation = `${url.host}/${
|
|
175
|
+
const url = new URL(publishingDetails.url);
|
|
176
|
+
const repoLocation = `${url.host}/${publishingDetails.username}`;
|
|
178
177
|
const name = `${properties.name}:${properties.version}`;
|
|
179
178
|
|
|
180
179
|
logger(`Publishing to ${repoLocation}`);
|
|
181
180
|
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
let p1 = await execa(this.constructor.name, [
|
|
182
|
+
"tag",
|
|
183
|
+
artifact,
|
|
184
|
+
`${repoLocation}/${name}`
|
|
185
|
+
]);
|
|
186
|
+
let p2 = await execa(this.constructor.name, [
|
|
187
|
+
"push",
|
|
188
|
+
`${repoLocation}/${name}`
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
//console.log(`docker tag ${artifact} ${repoLocation}/${name}`);
|
|
192
|
+
//console.log(`docker push ${repoLocation}/${name}`);
|
|
184
193
|
} catch (e) {
|
|
185
|
-
console.log(e,
|
|
194
|
+
console.log(e, publishingDetails.url);
|
|
186
195
|
}
|
|
187
196
|
}
|
|
188
197
|
}
|
package/src/output/oci.mjs
CHANGED
|
@@ -76,14 +76,15 @@ export class OCI extends Packager {
|
|
|
76
76
|
return `${p.name}-${p.version}${this.fileNameExtension}`;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
async
|
|
79
|
+
async create(
|
|
80
80
|
sources,
|
|
81
81
|
transformer,
|
|
82
82
|
dependencies,
|
|
83
|
+
publishingDetails,
|
|
83
84
|
options,
|
|
84
85
|
expander = v => v
|
|
85
86
|
) {
|
|
86
|
-
const { properties, destination } = await this.
|
|
87
|
+
const { properties, destination } = await this.prepare(options);
|
|
87
88
|
const packageFile = join(destination, this.packageFileName);
|
|
88
89
|
|
|
89
90
|
const meta = {
|