npm-pkgbuild 20.5.0 → 20.6.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 +61 -61
- package/package.json +4 -4
- package/src/output/arch.mjs +27 -14
- package/src/output/debian.mjs +6 -1
- package/src/output/docker.mjs +4 -1
- package/src/output/oci.mjs +1 -1
- package/src/output/rpm.mjs +4 -5
- package/src/utis.mjs +1 -1
- package/types/utis.d.mts +1 -1
package/README.md
CHANGED
|
@@ -98,47 +98,47 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
98
98
|
* [Properties](#properties)
|
|
99
99
|
* [extractFromPackage](#extractfrompackage)
|
|
100
100
|
* [Parameters](#parameters-1)
|
|
101
|
-
* [
|
|
102
|
-
* [ContentProvider](#contentprovider)
|
|
101
|
+
* [NPMPackContentProvider](#npmpackcontentprovider)
|
|
103
102
|
* [Parameters](#parameters-2)
|
|
104
103
|
* [Properties](#properties-1)
|
|
105
|
-
* [asyncIterator](#asynciterator)
|
|
106
|
-
* [FileContentProvider](#filecontentprovider)
|
|
107
|
-
* [Parameters](#parameters-3)
|
|
108
|
-
* [asyncIterator](#asynciterator-1)
|
|
109
104
|
* [name](#name)
|
|
110
105
|
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
111
|
-
* [Parameters](#parameters-
|
|
106
|
+
* [Parameters](#parameters-3)
|
|
112
107
|
* [Properties](#properties-2)
|
|
113
|
-
* [asyncIterator](#asynciterator
|
|
108
|
+
* [asyncIterator](#asynciterator)
|
|
114
109
|
* [name](#name-1)
|
|
115
|
-
* [
|
|
116
|
-
* [Parameters](#parameters-
|
|
117
|
-
* [
|
|
110
|
+
* [FileContentProvider](#filecontentprovider)
|
|
111
|
+
* [Parameters](#parameters-4)
|
|
112
|
+
* [asyncIterator](#asynciterator-1)
|
|
118
113
|
* [name](#name-2)
|
|
119
114
|
* [NFTContentProvider](#nftcontentprovider)
|
|
115
|
+
* [Parameters](#parameters-5)
|
|
116
|
+
* [asyncIterator](#asynciterator-2)
|
|
117
|
+
* [name](#name-3)
|
|
118
|
+
* [ContentProvider](#contentprovider)
|
|
120
119
|
* [Parameters](#parameters-6)
|
|
120
|
+
* [Properties](#properties-3)
|
|
121
121
|
* [asyncIterator](#asynciterator-3)
|
|
122
|
-
* [name](#name-3)
|
|
123
122
|
* [DEBIAN](#debian)
|
|
124
123
|
* [hookMapping](#hookmapping)
|
|
125
124
|
* [attributes](#attributes)
|
|
126
125
|
* [prepare](#prepare)
|
|
127
126
|
* [Parameters](#parameters-7)
|
|
127
|
+
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
128
|
+
* [attributes](#attributes-1)
|
|
128
129
|
* [quoteFile](#quotefile)
|
|
129
130
|
* [Parameters](#parameters-8)
|
|
130
131
|
* [RPM](#rpm)
|
|
131
132
|
* [hookMapping](#hookmapping-1)
|
|
132
|
-
* [attributes](#attributes-
|
|
133
|
+
* [attributes](#attributes-2)
|
|
133
134
|
* [prepare](#prepare-1)
|
|
134
135
|
* [Parameters](#parameters-9)
|
|
135
|
-
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
136
|
-
* [attributes](#attributes-2)
|
|
137
136
|
* [OCI](#oci)
|
|
138
137
|
* [DOCKER](#docker)
|
|
139
138
|
* [attributes](#attributes-3)
|
|
140
139
|
* [prepare](#prepare-2)
|
|
141
140
|
* [Parameters](#parameters-10)
|
|
141
|
+
* [BUILDAH](#buildah)
|
|
142
142
|
* [Packager](#packager)
|
|
143
143
|
* [Parameters](#parameters-11)
|
|
144
144
|
* [packageName](#packagename)
|
|
@@ -256,48 +256,22 @@ Extract package definition from package.json.
|
|
|
256
256
|
|
|
257
257
|
Returns **AsyncIterable<[PackageDefinition](#packagedefinition)>** 
|
|
258
258
|
|
|
259
|
-
##
|
|
260
|
-
|
|
261
|
-
**Extends DOCKER**
|
|
262
|
-
|
|
263
|
-
Use buildah @see <https://buildah.io>
|
|
259
|
+
## NPMPackContentProvider
|
|
264
260
|
|
|
265
|
-
|
|
261
|
+
**Extends ContentProvider**
|
|
266
262
|
|
|
267
|
-
|
|
263
|
+
Content from npm pack.
|
|
268
264
|
|
|
269
265
|
### Parameters
|
|
270
266
|
|
|
271
267
|
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
272
|
-
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
273
|
-
* `directoryProperties`
|
|
268
|
+
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
|
|
269
|
+
* `directoryProperties`  
|
|
274
270
|
|
|
275
271
|
### Properties
|
|
276
272
|
|
|
277
273
|
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
278
274
|
|
|
279
|
-
### asyncIterator
|
|
280
|
-
|
|
281
|
-
List all entries.
|
|
282
|
-
|
|
283
|
-
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
284
|
-
|
|
285
|
-
## FileContentProvider
|
|
286
|
-
|
|
287
|
-
**Extends ContentProvider**
|
|
288
|
-
|
|
289
|
-
Content provided form the file system.
|
|
290
|
-
|
|
291
|
-
### Parameters
|
|
292
|
-
|
|
293
|
-
* `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))** 
|
|
294
|
-
* `entryProperties`  
|
|
295
|
-
* `directoryProperties`  
|
|
296
|
-
|
|
297
|
-
### asyncIterator
|
|
298
|
-
|
|
299
|
-
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
300
|
-
|
|
301
275
|
### name
|
|
302
276
|
|
|
303
277
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
@@ -329,21 +303,21 @@ Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
|
329
303
|
|
|
330
304
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
331
305
|
|
|
332
|
-
##
|
|
306
|
+
## FileContentProvider
|
|
333
307
|
|
|
334
308
|
**Extends ContentProvider**
|
|
335
309
|
|
|
336
|
-
Content
|
|
310
|
+
Content provided form the file system.
|
|
337
311
|
|
|
338
312
|
### Parameters
|
|
339
313
|
|
|
340
|
-
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
341
|
-
* `entryProperties`
|
|
314
|
+
* `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))** 
|
|
315
|
+
* `entryProperties`  
|
|
342
316
|
* `directoryProperties`  
|
|
343
317
|
|
|
344
|
-
###
|
|
318
|
+
### asyncIterator
|
|
345
319
|
|
|
346
|
-
|
|
320
|
+
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
347
321
|
|
|
348
322
|
### name
|
|
349
323
|
|
|
@@ -369,6 +343,26 @@ Returns **AsyncIterable\<ContentEntry>** all entries
|
|
|
369
343
|
|
|
370
344
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
371
345
|
|
|
346
|
+
## ContentProvider
|
|
347
|
+
|
|
348
|
+
Source of package content.
|
|
349
|
+
|
|
350
|
+
### Parameters
|
|
351
|
+
|
|
352
|
+
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
353
|
+
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
354
|
+
* `directoryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
355
|
+
|
|
356
|
+
### Properties
|
|
357
|
+
|
|
358
|
+
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
359
|
+
|
|
360
|
+
### asyncIterator
|
|
361
|
+
|
|
362
|
+
List all entries.
|
|
363
|
+
|
|
364
|
+
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
365
|
+
|
|
372
366
|
## DEBIAN
|
|
373
367
|
|
|
374
368
|
**Extends Packager**
|
|
@@ -395,6 +389,15 @@ Map install hook named from default (arch) to deb.
|
|
|
395
389
|
|
|
396
390
|
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
391
|
|
|
392
|
+
## pkgKeyValuePairOptions
|
|
393
|
+
|
|
394
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
395
|
+
|
|
396
|
+
## attributes
|
|
397
|
+
|
|
398
|
+
well known package properties
|
|
399
|
+
<https://www.archlinux.org/pacman/PKGBUILD.5.html>
|
|
400
|
+
|
|
398
401
|
## quoteFile
|
|
399
402
|
|
|
400
403
|
### Parameters
|
|
@@ -428,15 +431,6 @@ Check for rpmbuild presence.
|
|
|
428
431
|
|
|
429
432
|
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
|
|
430
433
|
|
|
431
|
-
## pkgKeyValuePairOptions
|
|
432
|
-
|
|
433
|
-
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
434
|
-
|
|
435
|
-
## attributes
|
|
436
|
-
|
|
437
|
-
well known package properties
|
|
438
|
-
<https://www.archlinux.org/pacman/PKGBUILD.5.html>
|
|
439
|
-
|
|
440
434
|
## OCI
|
|
441
435
|
|
|
442
436
|
**Extends Packager**
|
|
@@ -466,6 +460,12 @@ Check for docker presence.
|
|
|
466
460
|
|
|
467
461
|
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
|
|
468
462
|
|
|
463
|
+
## BUILDAH
|
|
464
|
+
|
|
465
|
+
**Extends DOCKER**
|
|
466
|
+
|
|
467
|
+
Use buildah @see <https://buildah.io>
|
|
468
|
+
|
|
469
469
|
## Packager
|
|
470
470
|
|
|
471
471
|
### Parameters
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.6.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
7
7
|
},
|
|
8
|
-
"packageManager": "npm@11.
|
|
8
|
+
"packageManager": "npm@11.9.0+sha512.04166853ddba142ca98f86fb57b1258a7c6c59ccb82acb3cf141b77a315898acaaed47395e74f7e0c7b69c486008e68be6a6381ef1aee5a23dd82e0e61decd68",
|
|
9
9
|
"types": "./types/module.d.mts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"package-directory": "^8.2.0",
|
|
71
71
|
"pacote": "^21.2.0",
|
|
72
72
|
"tar-stream": "^3.1.7",
|
|
73
|
-
"uti": "^8.
|
|
73
|
+
"uti": "^8.11.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@types/node": "^25.2.
|
|
76
|
+
"@types/node": "^25.2.2",
|
|
77
77
|
"ava": "^6.4.1",
|
|
78
78
|
"c8": "^10.1.3",
|
|
79
79
|
"documentation": "^14.0.3",
|
package/src/output/arch.mjs
CHANGED
|
@@ -2,7 +2,12 @@ import { join } from "node:path";
|
|
|
2
2
|
import { createWriteStream } from "node:fs";
|
|
3
3
|
import { readFile, writeFile } from "node:fs/promises";
|
|
4
4
|
import { execa } from "execa";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
default_attribute,
|
|
7
|
+
string_attribute,
|
|
8
|
+
string_collection_attribute_writable,
|
|
9
|
+
integer_attribute
|
|
10
|
+
} from "pacc";
|
|
6
11
|
import { ContentEntry, IteratorContentEntry } from "content-entry";
|
|
7
12
|
import { transform } from "content-entry-transform";
|
|
8
13
|
import {
|
|
@@ -62,7 +67,6 @@ let _prepared;
|
|
|
62
67
|
let _architecture = "aarch64";
|
|
63
68
|
|
|
64
69
|
export class ARCH extends Packager {
|
|
65
|
-
|
|
66
70
|
static get alias() {
|
|
67
71
|
return "alpm";
|
|
68
72
|
}
|
|
@@ -84,7 +88,11 @@ export class ARCH extends Packager {
|
|
|
84
88
|
* https://www.archlinux.org/pacman/PKGBUILD.5.html
|
|
85
89
|
*/
|
|
86
90
|
static attributes = {
|
|
87
|
-
Maintainer: {
|
|
91
|
+
Maintainer: {
|
|
92
|
+
...string_collection_attribute_writable,
|
|
93
|
+
alias: "maintainer",
|
|
94
|
+
prefix: "# "
|
|
95
|
+
},
|
|
88
96
|
packager: { ...string_collection_attribute_writable, alias: "maintainer" },
|
|
89
97
|
pkgname: { ...pkgbuild_name_attribute, collection: true },
|
|
90
98
|
pkgver: pkgbuild_version_attribute,
|
|
@@ -110,9 +118,15 @@ export class ARCH extends Packager {
|
|
|
110
118
|
sha384sums: string_collection_attribute_writable,
|
|
111
119
|
sha512sums: string_collection_attribute_writable,
|
|
112
120
|
groups: string_collection_attribute_writable,
|
|
113
|
-
arch: {
|
|
121
|
+
arch: {
|
|
122
|
+
...string_collection_attribute_writable,
|
|
123
|
+
default: ["any"],
|
|
124
|
+
mandatory: true
|
|
125
|
+
},
|
|
114
126
|
backup: string_collection_attribute_writable,
|
|
115
|
-
depends: {
|
|
127
|
+
depends: {
|
|
128
|
+
...dependency_attribute_collection_writable /*, alias: "dependencies" */
|
|
129
|
+
},
|
|
116
130
|
makedepends: dependency_attribute_collection_writable,
|
|
117
131
|
checkdepends: dependency_attribute_collection_writable,
|
|
118
132
|
optdepends: dependency_attribute_collection_writable,
|
|
@@ -232,7 +246,10 @@ package() {
|
|
|
232
246
|
const ownership = [];
|
|
233
247
|
|
|
234
248
|
for await (const file of copyEntries(
|
|
235
|
-
transform(
|
|
249
|
+
transform(
|
|
250
|
+
aggregateFifo((await Array.fromAsync(sources)).flat()),
|
|
251
|
+
transformer
|
|
252
|
+
),
|
|
236
253
|
join(staging, "src"),
|
|
237
254
|
expander
|
|
238
255
|
)) {
|
|
@@ -281,14 +298,10 @@ package() {
|
|
|
281
298
|
makePackageOptions.push("--log");
|
|
282
299
|
}
|
|
283
300
|
|
|
284
|
-
const makepkg = await execa(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
cwd: staging,
|
|
289
|
-
env: { PKGDEST: destination, PACKAGER }
|
|
290
|
-
}
|
|
291
|
-
);
|
|
301
|
+
const makepkg = await execa("makepkg", makePackageOptions, {
|
|
302
|
+
cwd: staging,
|
|
303
|
+
env: { PKGDEST: destination, PACKAGER }
|
|
304
|
+
});
|
|
292
305
|
|
|
293
306
|
if (options.verbose) {
|
|
294
307
|
console.log(makepkg.stdout);
|
package/src/output/debian.mjs
CHANGED
|
@@ -167,7 +167,12 @@ export class DEBIAN extends Packager {
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
for await (const file of copyEntries(
|
|
170
|
-
transform(
|
|
170
|
+
transform(
|
|
171
|
+
aggregateFifo(
|
|
172
|
+
[await Array.fromAsync(sources), this.hookContent()].flat()
|
|
173
|
+
),
|
|
174
|
+
transformer
|
|
175
|
+
),
|
|
171
176
|
staging,
|
|
172
177
|
expander
|
|
173
178
|
)) {
|
package/src/output/docker.mjs
CHANGED
|
@@ -141,7 +141,10 @@ export class DOCKER extends Packager {
|
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
for await (const file of copyEntries(
|
|
144
|
-
transform(
|
|
144
|
+
transform(
|
|
145
|
+
aggregateFifo((await Array.fromAsync(sources)).flat()),
|
|
146
|
+
transformer
|
|
147
|
+
),
|
|
145
148
|
staging,
|
|
146
149
|
expander
|
|
147
150
|
)) {
|
package/src/output/oci.mjs
CHANGED
|
@@ -119,7 +119,7 @@ export class OCI extends Packager {
|
|
|
119
119
|
|
|
120
120
|
let pos = 0;
|
|
121
121
|
|
|
122
|
-
for await (const entry of aggregateFifo(sources)) {
|
|
122
|
+
for await (const entry of aggregateFifo((await Array.fromAsync(sources)).flat())) {
|
|
123
123
|
// const size = await entry.size;
|
|
124
124
|
const buffer = await entry.buffer;
|
|
125
125
|
const size = buffer.length;
|
package/src/output/rpm.mjs
CHANGED
|
@@ -138,9 +138,8 @@ export class RPM extends Packager {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
async create(sources, transformer, publishingDetails, options, expander) {
|
|
141
|
-
const { properties, tmpdir, staging, destination } =
|
|
142
|
-
options
|
|
143
|
-
);
|
|
141
|
+
const { properties, tmpdir, staging, destination } =
|
|
142
|
+
await this.prepare(options);
|
|
144
143
|
|
|
145
144
|
properties.Requires = this.makeDepends(properties.dependencies);
|
|
146
145
|
|
|
@@ -169,7 +168,7 @@ export class RPM extends Packager {
|
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
for await (const file of copyEntries(
|
|
172
|
-
|
|
171
|
+
transform(aggregateFifo((await Array.fromAsync(sources)).flat()), transformer),
|
|
173
172
|
staging,
|
|
174
173
|
expander
|
|
175
174
|
)) {
|
|
@@ -183,7 +182,7 @@ export class RPM extends Packager {
|
|
|
183
182
|
const fp = fieldProvider(properties, this.attributes);
|
|
184
183
|
|
|
185
184
|
for await (const file of copyEntries(
|
|
186
|
-
transform(aggregateFifo(sources), [
|
|
185
|
+
transform(aggregateFifo((await Array.fromAsync(sources)).flat()), [
|
|
187
186
|
{
|
|
188
187
|
match: entry => entry.name === specFileName,
|
|
189
188
|
transform: async entry =>
|
package/src/utis.mjs
CHANGED