npm-pkgbuild 20.10.0 → 21.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/README.md +74 -74
- package/package.json +6 -5
- package/src/extract-from-package.mjs +2 -2
- package/src/module.mjs +1 -1
- package/src/output/{arch.mjs → alpm.mjs} +5 -5
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## npm-pkgbuild
|
|
12
12
|
|
|
13
|
-
Create
|
|
13
|
+
Create ALPM, RPM, Debian and Docker packages from npm packages.
|
|
14
14
|
|
|
15
15
|
# usage
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ In a package directory execute
|
|
|
20
20
|
npm-pkgbuild --rpm --debian --arch --content /destination:build --publish /some/directory
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
This will create a
|
|
23
|
+
This will create a alpm, rpm and a debian package of the build dir.
|
|
24
24
|
|
|
25
25
|
## upload package
|
|
26
26
|
|
|
@@ -51,7 +51,7 @@ You can specify the package content in package.json.
|
|
|
51
51
|
"output": {
|
|
52
52
|
"debian" : {},
|
|
53
53
|
"rpm" : {},
|
|
54
|
-
"
|
|
54
|
+
"alpm" : {}
|
|
55
55
|
},
|
|
56
56
|
"dependencies": { "nginx" : ">=1.12" }
|
|
57
57
|
}
|
|
@@ -97,49 +97,49 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
97
97
|
* [Properties](#properties)
|
|
98
98
|
* [extractFromPackage](#extractfrompackage)
|
|
99
99
|
* [Parameters](#parameters-1)
|
|
100
|
-
* [
|
|
100
|
+
* [BUILDAH](#buildah)
|
|
101
|
+
* [ContentProvider](#contentprovider)
|
|
101
102
|
* [Parameters](#parameters-2)
|
|
102
103
|
* [Properties](#properties-1)
|
|
103
|
-
* [
|
|
104
|
-
* [
|
|
105
|
-
* [Parameters](#parameters-3)
|
|
106
|
-
* [Properties](#properties-2)
|
|
104
|
+
* [propertiesFor](#propertiesfor)
|
|
105
|
+
* [Parameters](#parameters-3)
|
|
107
106
|
* [asyncIterator](#asynciterator)
|
|
108
|
-
* [name](#name-1)
|
|
109
107
|
* [FileContentProvider](#filecontentprovider)
|
|
110
108
|
* [Parameters](#parameters-4)
|
|
111
109
|
* [asyncIterator](#asynciterator-1)
|
|
112
|
-
* [name](#name
|
|
113
|
-
* [
|
|
110
|
+
* [name](#name)
|
|
111
|
+
* [NodeModulesContentProvider](#nodemodulescontentprovider)
|
|
114
112
|
* [Parameters](#parameters-5)
|
|
113
|
+
* [Properties](#properties-2)
|
|
115
114
|
* [asyncIterator](#asynciterator-2)
|
|
116
|
-
* [name](#name-
|
|
117
|
-
* [
|
|
115
|
+
* [name](#name-1)
|
|
116
|
+
* [NPMPackContentProvider](#npmpackcontentprovider)
|
|
118
117
|
* [Parameters](#parameters-6)
|
|
119
118
|
* [Properties](#properties-3)
|
|
120
|
-
* [
|
|
121
|
-
|
|
119
|
+
* [name](#name-2)
|
|
120
|
+
* [NFTContentProvider](#nftcontentprovider)
|
|
121
|
+
* [Parameters](#parameters-7)
|
|
122
122
|
* [asyncIterator](#asynciterator-3)
|
|
123
|
+
* [name](#name-3)
|
|
123
124
|
* [DEBIAN](#debian)
|
|
124
125
|
* [hookMapping](#hookmapping)
|
|
125
126
|
* [attributes](#attributes)
|
|
126
127
|
* [prepare](#prepare)
|
|
127
128
|
* [Parameters](#parameters-8)
|
|
128
|
-
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
129
|
-
* [attributes](#attributes-1)
|
|
130
129
|
* [quoteFile](#quotefile)
|
|
131
130
|
* [Parameters](#parameters-9)
|
|
132
131
|
* [RPM](#rpm)
|
|
133
132
|
* [hookMapping](#hookmapping-1)
|
|
134
|
-
* [attributes](#attributes-
|
|
133
|
+
* [attributes](#attributes-1)
|
|
135
134
|
* [prepare](#prepare-1)
|
|
136
135
|
* [Parameters](#parameters-10)
|
|
136
|
+
* [pkgKeyValuePairOptions](#pkgkeyvaluepairoptions)
|
|
137
|
+
* [attributes](#attributes-2)
|
|
137
138
|
* [OCI](#oci)
|
|
138
139
|
* [DOCKER](#docker)
|
|
139
140
|
* [attributes](#attributes-3)
|
|
140
141
|
* [prepare](#prepare-2)
|
|
141
142
|
* [Parameters](#parameters-11)
|
|
142
|
-
* [BUILDAH](#buildah)
|
|
143
143
|
* [Packager](#packager)
|
|
144
144
|
* [Parameters](#parameters-12)
|
|
145
145
|
* [packageName](#packagename)
|
|
@@ -257,22 +257,57 @@ Extract package definition from package.json.
|
|
|
257
257
|
|
|
258
258
|
Returns **AsyncIterable<[PackageDefinition](#packagedefinition)>** 
|
|
259
259
|
|
|
260
|
-
##
|
|
260
|
+
## BUILDAH
|
|
261
261
|
|
|
262
|
-
**Extends
|
|
262
|
+
**Extends DOCKER**
|
|
263
263
|
|
|
264
|
-
|
|
264
|
+
Use buildah @see <https://buildah.io>
|
|
265
|
+
|
|
266
|
+
## ContentProvider
|
|
267
|
+
|
|
268
|
+
Source of package content.
|
|
265
269
|
|
|
266
270
|
### Parameters
|
|
267
271
|
|
|
268
272
|
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
269
|
-
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
270
|
-
* `directoryProperties`
|
|
273
|
+
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
274
|
+
* `directoryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
271
275
|
|
|
272
276
|
### Properties
|
|
273
277
|
|
|
274
278
|
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
275
279
|
|
|
280
|
+
### propertiesFor
|
|
281
|
+
|
|
282
|
+
#### Parameters
|
|
283
|
+
|
|
284
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
285
|
+
* `isCollection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
286
|
+
|
|
287
|
+
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** 
|
|
288
|
+
|
|
289
|
+
### asyncIterator
|
|
290
|
+
|
|
291
|
+
List all entries.
|
|
292
|
+
|
|
293
|
+
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
294
|
+
|
|
295
|
+
## FileContentProvider
|
|
296
|
+
|
|
297
|
+
**Extends ContentProvider**
|
|
298
|
+
|
|
299
|
+
Content provided form the file system.
|
|
300
|
+
|
|
301
|
+
### Parameters
|
|
302
|
+
|
|
303
|
+
* `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))** 
|
|
304
|
+
* `entryProperties`  
|
|
305
|
+
* `directoryProperties`  
|
|
306
|
+
|
|
307
|
+
### asyncIterator
|
|
308
|
+
|
|
309
|
+
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
310
|
+
|
|
276
311
|
### name
|
|
277
312
|
|
|
278
313
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
@@ -304,21 +339,21 @@ Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
|
304
339
|
|
|
305
340
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
306
341
|
|
|
307
|
-
##
|
|
342
|
+
## NPMPackContentProvider
|
|
308
343
|
|
|
309
344
|
**Extends ContentProvider**
|
|
310
345
|
|
|
311
|
-
Content
|
|
346
|
+
Content from npm pack.
|
|
312
347
|
|
|
313
348
|
### Parameters
|
|
314
349
|
|
|
315
|
-
* `definitions` **
|
|
316
|
-
* `entryProperties`
|
|
350
|
+
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
351
|
+
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** to be set for each entry
|
|
317
352
|
* `directoryProperties`  
|
|
318
353
|
|
|
319
|
-
###
|
|
354
|
+
### Properties
|
|
320
355
|
|
|
321
|
-
|
|
356
|
+
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
322
357
|
|
|
323
358
|
### name
|
|
324
359
|
|
|
@@ -344,35 +379,6 @@ Returns **AsyncIterable\<ContentEntry>** all entries
|
|
|
344
379
|
|
|
345
380
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the content provider
|
|
346
381
|
|
|
347
|
-
## ContentProvider
|
|
348
|
-
|
|
349
|
-
Source of package content.
|
|
350
|
-
|
|
351
|
-
### Parameters
|
|
352
|
-
|
|
353
|
-
* `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
354
|
-
* `entryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
355
|
-
* `directoryProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
356
|
-
|
|
357
|
-
### Properties
|
|
358
|
-
|
|
359
|
-
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
360
|
-
|
|
361
|
-
### propertiesFor
|
|
362
|
-
|
|
363
|
-
#### Parameters
|
|
364
|
-
|
|
365
|
-
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
366
|
-
* `isCollection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
367
|
-
|
|
368
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
369
|
-
|
|
370
|
-
### asyncIterator
|
|
371
|
-
|
|
372
|
-
List all entries.
|
|
373
|
-
|
|
374
|
-
Returns **AsyncIterable<(ContentEntry | CollectionEntry)>** all entries
|
|
375
|
-
|
|
376
382
|
## DEBIAN
|
|
377
383
|
|
|
378
384
|
**Extends Packager**
|
|
@@ -399,15 +405,6 @@ Map install hook named from default (arch) to deb.
|
|
|
399
405
|
|
|
400
406
|
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)>** 
|
|
401
407
|
|
|
402
|
-
## pkgKeyValuePairOptions
|
|
403
|
-
|
|
404
|
-
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
405
|
-
|
|
406
|
-
## attributes
|
|
407
|
-
|
|
408
|
-
well known package properties
|
|
409
|
-
<https://www.archlinux.org/pacman/PKGBUILD.5.html>
|
|
410
|
-
|
|
411
408
|
## quoteFile
|
|
412
409
|
|
|
413
410
|
### Parameters
|
|
@@ -441,6 +438,15 @@ Check for rpmbuild presence.
|
|
|
441
438
|
|
|
442
439
|
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
|
|
443
440
|
|
|
441
|
+
## pkgKeyValuePairOptions
|
|
442
|
+
|
|
443
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
444
|
+
|
|
445
|
+
## attributes
|
|
446
|
+
|
|
447
|
+
well known package properties
|
|
448
|
+
<https://www.archlinux.org/pacman/PKGBUILD.5.html>
|
|
449
|
+
|
|
444
450
|
## OCI
|
|
445
451
|
|
|
446
452
|
**Extends Packager**
|
|
@@ -470,12 +476,6 @@ Check for docker presence.
|
|
|
470
476
|
|
|
471
477
|
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
|
|
472
478
|
|
|
473
|
-
## BUILDAH
|
|
474
|
-
|
|
475
|
-
**Extends DOCKER**
|
|
476
|
-
|
|
477
|
-
Use buildah @see <https://buildah.io>
|
|
478
|
-
|
|
479
479
|
## Packager
|
|
480
480
|
|
|
481
481
|
### Parameters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"default": "./src/module.mjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"description": "create
|
|
14
|
+
"description": "create ALPM, RPM and Debian packages from npm packages",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"ArchLinux",
|
|
17
17
|
"arch-linux",
|
|
18
|
+
"alpm",
|
|
18
19
|
"aur",
|
|
19
20
|
"buildah",
|
|
20
21
|
"deb",
|
|
@@ -51,9 +52,9 @@
|
|
|
51
52
|
"aggregate-async-iterator": "^1.2.5",
|
|
52
53
|
"commander": "^15.0.0",
|
|
53
54
|
"compare-versions": "^6.1.1",
|
|
54
|
-
"content-entry": "^15.0.
|
|
55
|
-
"content-entry-filesystem": "^9.1.
|
|
56
|
-
"content-entry-transform": "^1.7.
|
|
55
|
+
"content-entry": "^15.0.2",
|
|
56
|
+
"content-entry-filesystem": "^9.1.1",
|
|
57
|
+
"content-entry-transform": "^1.7.3",
|
|
57
58
|
"execa": "^10.0.1",
|
|
58
59
|
"ini": "^7.0.0",
|
|
59
60
|
"iterable-string-interceptor": "^3.0.8",
|
|
@@ -10,7 +10,7 @@ import { FileContentProvider } from "./content/file-content-provider.mjs";
|
|
|
10
10
|
import { NFTContentProvider } from "./content/nft-content-provider.mjs";
|
|
11
11
|
import { ContentProvider } from "./content/content-provider.mjs";
|
|
12
12
|
import { DEBIAN } from "./output/debian.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { ALPM } from "./output/alpm.mjs";
|
|
14
14
|
import { RPM } from "./output/rpm.mjs";
|
|
15
15
|
import { OCI } from "./output/oci.mjs";
|
|
16
16
|
import { DOCKER } from "./output/docker.mjs";
|
|
@@ -29,7 +29,7 @@ export const allInputs = [
|
|
|
29
29
|
/**
|
|
30
30
|
* All output formats
|
|
31
31
|
*/
|
|
32
|
-
export const allOutputs = [
|
|
32
|
+
export const allOutputs = [ALPM, RPM, OCI, DOCKER, BUILDAH, DEBIAN];
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Node architecture name to os native arch name mapping
|
package/src/module.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs"
|
|
|
13
13
|
export { NFTContentProvider } from "./content/nft-content-provider.mjs";
|
|
14
14
|
export { DEBIAN } from "./output/debian.mjs";
|
|
15
15
|
export { RPM } from "./output/rpm.mjs";
|
|
16
|
-
export {
|
|
16
|
+
export { ALPM } from "./output/alpm.mjs";
|
|
17
17
|
export { OCI } from "./output/oci.mjs";
|
|
18
18
|
export { DOCKER } from "./output/docker.mjs";
|
|
19
19
|
export { Packager } from "./output/packager.mjs";
|
|
@@ -56,7 +56,7 @@ export const pkgKeyValuePairOptions = {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
function keyPrefix(key) {
|
|
59
|
-
const f =
|
|
59
|
+
const f = ALPM.attributes[key];
|
|
60
60
|
return f?.prefix ? f.prefix + key : key;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -66,9 +66,9 @@ let _ext = ".pkg.tar.xz";
|
|
|
66
66
|
let _prepared;
|
|
67
67
|
let _architecture = "aarch64";
|
|
68
68
|
|
|
69
|
-
export class
|
|
69
|
+
export class ALPM extends Packager {
|
|
70
70
|
static get alias() {
|
|
71
|
-
return "
|
|
71
|
+
return "arch";
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
static get name() {
|
|
@@ -295,13 +295,13 @@ package() {
|
|
|
295
295
|
const flags = {
|
|
296
296
|
user: ["-u", f => f.user],
|
|
297
297
|
group: ["-g", f => f.group],
|
|
298
|
-
mode: ["-m", f => Number(f.mode).toString(8)]
|
|
298
|
+
mode: ["-m", f => Number(f.mode && 0o7777).toString(8)] // TODO why only 12 bits
|
|
299
299
|
};
|
|
300
300
|
|
|
301
301
|
content =
|
|
302
302
|
content.substring(0, markerPos) +
|
|
303
303
|
permissions
|
|
304
|
-
.filter(f=>f.isBlob)
|
|
304
|
+
.filter(f => f.isBlob)
|
|
305
305
|
.map(f => {
|
|
306
306
|
const options = Object.keys(flags)
|
|
307
307
|
.filter(name => f[name])
|